| Hi Christopher Czyba, I think this is not a 5.X in fact based on the JPA 2.1 specification if no
is specified then the
have to be used for the database table name. So based on your example
@Entity(name="bug.Entity")
public class MyEntity{
....
}
will generate a the following DDL command
create table bug.Entity .....
that the db interprets as create a table named Entity into the bug schema. So if what you want is the 2 entities be mapped to the same table in the public schema, you can use the following mapping
@Entity(name = "bug_other.Entity")
@Table(name = "Entity")
public class MyEntity2 {
@Id
public long id2;
@Column
public long test2;
}
@Entity(name = "bug.Entity")
@Table(name = "Entity")
public class MyEntity {
@Id
public long id;
@Column
public long test;
}
but if you need to use different schemas then the way is to add the
with the appropriate name value. |