org.jpox.enhancer.asm.method
Class JdoCopyKeyFieldsToObjectId2
java.lang.Object
org.jpox.enhancer.ClassMethod
org.jpox.enhancer.asm.ASMClassMethod
org.jpox.enhancer.asm.method.JdoCopyKeyFieldsToObjectId2
public class JdoCopyKeyFieldsToObjectId2
- extends ASMClassMethod
Method to generate the method "jdoCopyKeyFieldsToObjectId" using ASM.
For datastore/nondurable identity
public final void jdoCopyKeyFieldsToObjectId(PersistenceCapable.ObjectIdFieldSupplier objectidfieldsupplier,
Object object)
{
}
and for SingleFieldIdentity
public final void jdoCopyKeyFieldsToObjectId(PersistenceCapable.ObjectIdFieldSupplier fs, Object oid)
{
throw new JDOFatalInternalException("It's illegal to call ...");
}
and for user-supplied app identity
public final void jdoCopyKeyFieldsToObjectId(PersistenceCapable.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 CompoundIdentity
public final void jdoCopyKeyFieldsToObjectId(PersistenceCapable.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)));
}
- Version:
- $Revision: 1.17 $
|
Constructor Summary |
JdoCopyKeyFieldsToObjectId2(ClassEnhancer enhancer,
java.lang.String name,
int access,
java.lang.Object returnType,
java.lang.Object[] argTypes,
java.lang.String[] argNames)
Constructor. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
JdoCopyKeyFieldsToObjectId2
public JdoCopyKeyFieldsToObjectId2(ClassEnhancer enhancer,
java.lang.String name,
int access,
java.lang.Object returnType,
java.lang.Object[] argTypes,
java.lang.String[] argNames)
- Constructor.
- Parameters:
enhancer - ClassEnhancername - Name of methodaccess - Access typereturnType - Return typeargTypes - Argument typesargNames - Argument names
getInstance
public static JdoCopyKeyFieldsToObjectId2 getInstance(ASMClassEnhancer enhancer)
execute
public void execute()
- Method to add the contents of the class method.
- Specified by:
execute in class ClassMethod
Copyright © -2008 . All Rights Reserved.