Hibernate version: 3.2.6.ga
Name and version of the database you are using: Oracle 10g
Hi,
I have the following
@Embeddable UserEntity class:
Code:
@Embeddable
public class UserEntity implements Serializable{
...
@Column(nullable = false, length = 8)
public String getName(){ return name; }
...
}
The
Provider class embeds the
UserEntity class and overrides the name of the column via the
AttributeOverride annotation:
Code:
@Entity
public class Provider implements Serializable{
...
@Embedded
@AttributeOverrides({
@AttributeOverride(name = "name", column = @Column(name = "prov_created_usr"))
})
public UserEntity getCreated(){ return created; }
...
}
The
hbm2ddl generates the following:
Code:
create table provider (prov_created_usr varchar2(255) ...);
and not this:
Code:
create table provider (prov_created_usr varchar2(8) not null ...);
The name of the column comes from the
Provider class and the datatype, length and not null attributes should come from the
@Embeddable UserEntity class.
Is this possible ?
regards,
Tim