0 Replies Latest reply on Jan 7, 2014 5:20 PM by jmanko

    Example EclipseLink orm.xml to change ID generation strategy on sample IDM entities

    jmanko

      I didn't like the AUTO generation strategy (which resulted in a SEQUENCE) used by the sample implementation, so here is an EclipseLink orm.xml you can use to change them to an IDENTITY generation strategy.

       

      <?xml version="1.0" encoding="UTF-8"?>

      <entity-mappings version="2.1"

                       xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"

                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

       

          <entity class="org.picketlink.idm.jpa.model.sample.simple.DigestCredentialTypeEntity">

              <attributes>                   

                  <id name="id">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>

         

          <entity class="org.picketlink.idm.jpa.model.sample.simple.OTPCredentialTypeEntity">

              <attributes>                   

                  <id name="id">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>

         

          <entity class="org.picketlink.idm.jpa.model.sample.simple.PasswordCredentialTypeEntity">

              <attributes>                   

                  <id name="id">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>

       

          <entity class="org.picketlink.idm.jpa.model.sample.simple.X509CredentialTypeEntity">

              <attributes>                   

                  <id name="id">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>

       

          <entity class="org.picketlink.idm.jpa.model.sample.simple.AttributeTypeEntity">

              <attributes>                   

                  <id name="id">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>

       

          <entity class="org.picketlink.idm.jpa.model.sample.simple.RelationshipIdentityTypeEntity">

              <attributes>                   

                  <id name="identifier">

                      <generated-value strategy="IDENTITY" />

                  </id>

              </attributes>

          </entity>           

         

      </entity-mappings>