[hibernate-issues] [Hibernate-JIRA] Created: (HBX-1162) ShemaExport and MappingDiagram aren't working properly with @Embedded annotation

Dzafar Sadik (JIRA) noreply at atlassian.com
Thu Apr 22 06:22:34 EDT 2010


ShemaExport and MappingDiagram aren't working properly with @Embedded annotation
--------------------------------------------------------------------------------

                 Key: HBX-1162
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1162
             Project: Hibernate Tools
          Issue Type: Bug
          Components: annotations (obsolete), visualizations
    Affects Versions: 3.2LATER
         Environment: Hibernate Core 3.5, MySQLDB
            Reporter: Dzafar Sadik


Fields of component that are embedded into some entity are not added to sql ddl statement nor shown on MappingDiagram. However when running an application proper columns are created in the database.

Simple example:

//Definition of component
@Embeddable
@Access(AccessType.FIELD)
public class Address {		
	protected String street;
	protected Integer house;
}


//Definition of class that includes component
import javax.persistence.*;

@Entity (name = "person")
public class Person{	
	private long id;		
	private Address address;
	
	public Person(){
		
	}
	
	
	@Id
	@GeneratedValue
	public Long getId(){
		return id;
	}
	
	public void setId(Long id){
		this.id = id;
	}
		
	@Embedded  
	public Address getPrimaryAddress(){
		return address;
	}
	
	public void setPrimaryAddress(Address address){
		this.address = address;
	}
	
}


Resulting table includes PRIMARYADDRESS column when running project with ddl auto create. However using SchemaExport from Hibernate Tools thre will be only ID column.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list