};
final String superOidClassName
= ImplHelper.normalizeClassName(meta.getSuperKeyClass(className));
JavaClassWriter oidWriter = new IOJavaClassWriter();
oidWriter.setClassDeclaration(
(enclosedOid ? Modifier.PUBLIC | Modifier.STATIC : 0),
oidClassName,
ImplHelper.COMMENT_NOT_ENHANCER_ADDED);
oidWriter.setSuperclass(superOidClassName);
oidWriter.addInterface(Serializable.class.getName());
final boolean isPCRoot
= meta.isPersistenceCapableRootClass(className);
final String[] pknames = meta.getKeyFields(className);
final String[] pktypes = meta.getFieldType(className, pknames);
// write the PK-fields
for (int i = 0; i < pknames.length; i++) {
oidWriter.addField(
pknames[i],
Modifier.PUBLIC,
ImplHelper.normalizeClassName(pktypes[i]),
null,
null);
}
// write default constructor
oidWriter.addConstructor(
oidClassName,
Modifier.PUBLIC,
null, null, null,
ImplHelper.getDefaultConstructorImpl(),
ImplHelper.COMMENT_NOT_ENHANCER_ADDED);
// hashCode
oidWriter.addMethod(
"hashCode",
Modifier.PUBLIC,
"int",
null,
null,
null,
ImplHelper.getOidHashCodeImpl(pknames,
pktypes,
isPCRoot),
ImplHelper.COMMENT_NOT_ENHANCER_ADDED);
// equals
oidWriter.addMethod(
"equals", Modifier.PUBLIC, JavaClassWriterHelper.boolean_,
new String[]{ "pk" },
new String[]{ Object.class.getName() },
null,
ImplHelper.getOidEqualsImpl(oidClassName,