Migration of datastore-identity strategy in JDO?

165 views Asked by At

The current configuration of JDO metadata we have all the clases like this:

    <class name="ObjectOne" identity-type="datastore" table="ObjectOne" requires-extent="true" detachable="false">
              <datastore-identity column="JDOID" strategy="native" >
                  </datastore-identity > 
</class>
    <class name="ObjectTwo" identity-type="datastore" table="ObjectTwo" requires-extent="true" detachable="false">
              <datastore-identity column="JDOID" strategy="native" >
                  </datastore-identity > 
</class>

But right the problem is this that the JDOID or the Id of the object is not sequencial. Example:

Object 1 JDOID  |  Object 2 JDOID
             1                  3
             2
             4

Like you see this is a Big Issue because the ID is the number of produced Object. But now I need to migrate this to a different datastore-identity strategy. I'm using auto-assign strategy and everything works in new tables like for Object 3 is generating from 1. But changing the strategy in ObjectOne and ObjectTwo is giving me that the id can't not be null. Any suggestions giving in this problem?

0

There are 0 answers