[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
You can't have associations to the root class if it's just a MappedSuperClass -- it has to be an entity. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4109493#4109493 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109493 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
have you tried using @MappedSuperclass then? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4109488#4109488 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4109488 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
The problem is that I have an Employee object associated with every Document. When the Employee goes away, the link has to be severed. Being able to do that implicitly (with cascade=CascadeType.REMOVE) would be the ideal solution. Right now I have a hack involving a custom annotation, parameter injection and an UPDATE query that fires whenever an Employee is deleted. Being able to have an association to Document directly would be a much cleaner solution. Document doesn't have its own table so it doesn't need a PK of its own. It'd be great if I could have getId() defined in Document, and override it in subclasses and set @GeneratedValue along with any specific generators there. I don't see any theoretical problems with that approach. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4108249#4108249 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108249 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
hmm, i can imagine problems with the pk. for example, say you have Document with its own pk. when you create SalesInvoice it inherits the pk from Document. if you try to add an additional field to SalesInvoice's pk, hibernate will probably choke because it's not properly defined as a composite pk. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4108248#4108248 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4108248 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
Because I need to have different sequences in subclasses. The root class is Document, and subclasses are SalesInvoice, OrderConfirmation etc that need to have their own numbering schemes. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4107654#4107654 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4107654 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [EJB 3.0] - Re: Table per class with different ID generators
one-to-many from the subclass to the root class? why not put the ID in the superclass? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4107620#4107620 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4107620 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user