Class NewObjectIdInstance2

java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.methods.NewObjectIdInstance2

public class NewObjectIdInstance2 extends ClassMethod
Method to generate the method "dnNewObjectIdInstance" using ASM. For datastore/nondurable identity this is
 public Object dnNewObjectIdInstance(Object key)
 {
     return null;
 }
 
and for SingleFieldIdentity
 public Object dnNewObjectIdInstance(Object key)
 {
     if (key == null)
         throw new IllegalArgumentException("key is null");
     if (key instanceof String != true)
         return new YYYIdentity(this.getClass(), (YYY) key);
     return new YYYIdentity(this.getClass(), (String) key);
 }
 
and for user-supplied object ids
 public Object dnNewObjectIdInstance(Object key)
 {
     return new UserPrimaryKey((String) key);
 }
 
  • Constructor Details

    • NewObjectIdInstance2

      public NewObjectIdInstance2(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames)
      Constructor.
      Parameters:
      enhancer - ClassEnhancer
      name - Name of method
      access - Access type
      returnType - Return type
      argTypes - Argument types
      argNames - Argument names
  • Method Details