[jboss-user] [EJB 3.0] - Re: Merging an extended class from existing superclass

wolfc do-not-reply at jboss.com
Fri May 25 06:23:39 EDT 2007


Reconsider the livecycle of your object. For example:
Dog dog = new Dog("Tom");
  | <do magic here>
  | assert dog instanceof SpottedDog : "magic failed";
I can't think of any magic that won't fail.

So you only solution is to make the SpottedDog an one on one association with Dog.
The code will then be some like:
@Entity
  | public class SpottedDog {
  |    @Id Long id;
  | 
  |    @OneToOne @PrimaryKeyColumnJoin
  |    Dog dog;
  | }
You may need to fully specify the one to one relationship as it may be an one way association.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048639#4048639

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048639



More information about the jboss-user mailing list