Hi, all,
I'm having some issues with declaring a mapped superclass in the middle of an EJB3 inheritance hierarchy. According to the documentation at
http://www.hibernate.org/hib_docs/annot ... tml#d0e901 this should be possible, but I can't seem to get it to work. Here's my situation:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class SubscriptionTransaction {...}
@Entity
public abstract class CreditCardTransaction extends SubscriptionTransaction{...}
@MappedSuperclass
public abstract class VoidableTransaction extends CreditCardTransaction{
@OneToOne(mappedBy="voidableTransaction")
private VoidTransaction voidTransaction;
...
}
@Entity public class AuthTransaction extends VoidableTransaction {...}
@Entity public class CaptureTransaction extends VoidableTransaction {...}
@Entity public class CreditTransaction extends VoidableTransaction {...}
@Entity public class VoidTransaction extends CreditCardTransaction {
@OneToOne(optional = false)
private VoidableTransaction voidableTransaction;
...
}
Essentially, I want each of the voidable transaction type tables to have a void_transaction_id (which may be null). I don't want to add complexity to the joins by making VoidableTransaction a separate entity (and thus adding a table) entirely.
The problem that I'm running into is that when I run hbm2ddl on these classes, void_transaction_id is missing entirely from the relevant subclass tables. I have a couple of other classes annotated with @MappedSuperclass in the project that are at the root of the inheritance hierarchy, and their properties get inherited just fine, so I assume that it must be something else I'm doing wrong. Does anyone have any suggestions?
Thanks very much,
Kris