- java.lang.Object
-
- org.datanucleus.enhancer.ClassMethod
-
- org.datanucleus.enhancer.methods.CopyKeyFieldsToObjectId2
-
public class CopyKeyFieldsToObjectId2 extends ClassMethod
Method to generate the method "dnCopyKeyFieldsToObjectId" using ASM. For datastore/nondurable identitypublic void dnCopyKeyFieldsToObjectId(Persistable.ObjectIdFieldSupplier objectidfieldsupplier, Object object) { }
and for SingleFieldIdentitypublic void dnCopyKeyFieldsToObjectId(Persistable.ObjectIdFieldSupplier fs, Object oid) { throw new JDOFatalInternalException("It's illegal to call ..."); }
and for user-supplied app identitypublic void dnCopyKeyFieldsToObjectId(Persistable.ObjectIdFieldSupplier fs, Object oid) { if (fs == null) throw new IllegalArgumentException("ObjectIdFieldSupplier is null"); if (oid instanceof UserPrimaryKey != true) throw new ClassCastException("oid is not instanceof mydomain.UserPrimaryKey"); UserPrimaryKey o = (UserPrimaryKey) oid; o.zzz1 = fs.fetchYYY1Field(1); o.zzz2 = fs.fetchYYY2Field(2); }
and for CompoundIdentitypublic void dnCopyKeyFieldsToObjectId(Persistable.ObjectIdFieldSupplier fs, Object oid) { if (fs == null) throw new IllegalArgumentException("ObjectIdFieldSupplier is null"); if (oid instanceof UserPrimaryKey != true) throw new ClassCastException("oid is not instanceof mydomain.UserPrimaryKey"); UserPrimaryKey o = (UserPrimaryKey) oid; o.zzz1 = fs.fetchYYYField(1); o.zzz2 = ((YYY2.Key)JDOHelper.getObjectId((YYY2)fs.fetchObjectField(2))); }
-
-
Field Summary
-
Fields inherited from class org.datanucleus.enhancer.ClassMethod
access, argNames, argTypes, enhancer, exceptions, methodName, returnType, visitor
-
-
Constructor Summary
Constructors Constructor Description CopyKeyFieldsToObjectId2(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Method to add the contents of the class method.static CopyKeyFieldsToObjectId2
getInstance(ClassEnhancer enhancer)
-
Methods inherited from class org.datanucleus.enhancer.ClassMethod
close, equals, getAccess, getClassEnhancer, getDescriptor, getMethodAdditionMessage, getName, getNamer, hashCode, initialise, initialise
-
-
-
-
Constructor Detail
-
CopyKeyFieldsToObjectId2
public CopyKeyFieldsToObjectId2(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames)
Constructor.- Parameters:
enhancer
- ClassEnhancername
- Name of methodaccess
- Access typereturnType
- Return typeargTypes
- Argument typesargNames
- Argument names
-
-
Method Detail
-
getInstance
public static CopyKeyFieldsToObjectId2 getInstance(ClassEnhancer enhancer)
-
execute
public void execute()
Method to add the contents of the class method.- Specified by:
execute
in classClassMethod
-
-