jpa - Try to use EmbeddedId in Superclass -


I have the following problem:

I have a composite with a composite class (as a superclass Used) primary key. And now I'am trying to setup subclasses correctly from base class, but it does not work! Can somebody help me out? Thanks

BasePK.java

  @ Embedded public class applies the bespoke serializeable {secure string base1; Protected Timestamp Base 2; ..}   

Base.java

  @MappedSuperclass @ Inheritance (strategy = inheritance type.TABLE_PER_CLASS) Public Intangible Class Base Tools Serializable {@EmbeddedId Safe BasePK ID; ..}   

SubClassA.java

SubClassB.java

Sub-class c. Java

When I open the project, the public class sub-class C subclass implements the serialacable (protected string atris c1; protected string atris c2; If you try to run, the following excaseions are made:

  [EL information]: 2012-11-01 23: 31: 18.739 - ServerSession (+2063330336) - EclipseLink, Version: Eclipse Hatha Services - 2.4.1.v20121003-ad44345 [EL Alert]: Metadata: 2012-11-01 23: 31: 19.199 - ServerSession (+2063330336) - - Voting Enabled Due to lack of or not, changing the lazy setting on the OneToOne or ManyToOne feature [controlled object] for the unit class [class logyourlife.entities.ChangeRecord]. [E.L. Critical]: 2012-11-01 23: 31: 19.229 - ServerSession (+2063330336) - Exception [EclipseLink-0] (Eclipse Stagnant Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions Integrity Option Descriptor Exception: ------------- -------------------------------- ------------ Exceptions [EclipseLink-48] (Eclipse stubborn services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.DescriptorException exception description: Multiple writeable me The area exists for ping [SUBCLASSB.BASE1] Only one can be defined as writable, all others should be specified for reading only. Mapping: org.eclipse.persistence.mappings.ManyToOneMapping [attra] Descriptors: RelationalDescriptor (test.entities.SubClassB -> Exceptions [EclipseLink-48] (Eclipse Attachment Services - 2.4.1.v20121003 -ad44345): org.eclipse.preistence.exceptions.DescriptorException exception description: There are multiple writeable mappings for the field [SUBCLASSB.BASE2]. Only one can be defined as writeable, all others should be specified for reading only. Mapping: org.eclipse.preistence.mappings.ManyToOneMapping [Attri] Descriptors: Relational Descriptors (test.entities.SubClassB -> [DatabaseTable (SUBCLASSB)])   

fyi: equals and Hashed method has been overwritten in all classes.

First of all, remove the inheritance code annotation on the base. It does not fulfill any purpose.

Then, try to clearly define similar columns for many organization organizations. It seems that EclipseLink uses the same column names as the embedded ID field and by default for one-to-one collaboration with all class A. For an example of using this annotation, see.

Side note: Composite IDs are both disabled, and are handy to handle. You should actually consider using autogenerated, single column IDs for all your entities. Everything will be very easy.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -