[jboss-user] [EJB 3.0] - Re: My collection is not initializing; due to inheritance?
snau2005
do-not-reply at jboss.com
Thu Aug 17 06:57:03 EDT 2006
I put here my example of 3 tables, i hope you asking of such example (in your case 2 tables)
| @MappedSuperclass
| public class IdTable implements Serializable {
| @Id @GeneratedValue(strategy=GenerationType.TABLE)
| public Long id;
|
| }
|
| @MappedSuperclass
| public abstract class BasicPrimaryTable extends IdTable {
|
| @Version public Integer version;
| }
|
| @Entity
| public class SomeTable extends BasicPrimaryTable {
|
| }
|
|
if you dont want to extend some calss you need put like this:
| @Embeddable
| public class SomeClass {
| @Column(nullable = false, length=255) public String name;
| }
|
| @Entity
| public class SomeTable {
| @Embedded private SomeClass some;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965694#3965694
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965694
More information about the jboss-user
mailing list