I have a bunch of autogenerated files that look similar to the following one:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FooType", propOrder = {
"bar",
"foobar"
})
@Entity(name = "FooType")
@Table(name = "FOOTYPE")
@Inheritance(strategy = InheritanceType.JOINED)
public class FooType
implements Serializable, Equals, HashCode {
// more stuff
}
These files are generated from a XML-Schema. What I need to do is adding caching capabilities to these classes. While there are various ways to add annotations to it, I'm required to use mapping files (.hbm.xml).
I've read somewhere that you can use .hbm.xml and annotations side by side, but when I've tried adding an hbm file like this one:
I got an org.hibernate.DuplicateMappingException. So, is it actually possible? What did I do wrong?