Class MCRObjectIDPK

java.lang.Object
org.mycore.backend.jpa.MCRObjectIDPK
All Implemented Interfaces:
Serializable

public class MCRObjectIDPK extends Object implements Serializable
Use this wrapper if you want a MCRObjectID as a primary key with name id in your JPA mapping.

 @Entity
 @IdClass(MCRObjectIDPK.class)
 public class EntityClass {

     private MCRObjectID id;

     […]

     @Id
     public MCRObjectID getId() {
         return id;
     }

     public void setId(MCRObjectID id) {
         this.id = id;
     }

     […]

 }
 
See Also:
  • Field Details

  • Constructor Details

    • MCRObjectIDPK

      public MCRObjectIDPK(MCRObjectID id)
      Use this constructor for quick queries. Sample-Code:
      
           EntityManager em = […];
           em.find(EntityClass.class, new MCRObjectIDPK(MCRObjectID.getInstance('mir_mods_00004711')));
       
      See Also:
    • MCRObjectIDPK

      public MCRObjectIDPK()
  • Method Details