org.datanucleus.enhancer.asm.method
Class JdoNewObjectIdInstance2
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoNewObjectIdInstance2
public class JdoNewObjectIdInstance2
- extends ASMClassMethod
Method to generate the method "jdoNewObjectIdInstance" using ASM.
For datastore/nondurable identity this is
public Object jdoNewObjectIdInstance(Object key)
{
return null;
}
and for SingleFieldIdentity
public Object jdoNewObjectIdInstance(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 jdoNewObjectIdInstance(Object key)
{
return new UserPrimaryKey((String) key);
}
JdoNewObjectIdInstance2
public JdoNewObjectIdInstance2(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
getInstance
public static JdoNewObjectIdInstance2 getInstance(ClassEnhancer enhancer)
execute
public void execute()
- Method to add the contents of the class method.
- Specified by:
execute in class ClassMethod
Copyright © 2012. All Rights Reserved.