/** * Accessor for the target class for the specified single field application-identity. * @param id The identity * @return The target class */ public Class getTargetClassForSingleFieldIdentity(Object id) { // TODO Use JPOX-internal SingleFieldIdentity if (id instanceof SingleFieldIdentity) { return ((SingleFieldIdentity)id).getTargetClass(); } return null; }
/** * Accessor for the target class for the specified single field application-identity. * @param id The identity * @return The target class */ public Class getTargetClassForSingleFieldIdentity(Object id) { // TODO Use JPOX-internal SingleFieldIdentity if (id instanceof SingleFieldIdentity) { return ((SingleFieldIdentity)id).getTargetClass(); } return null; }
public static SingleFieldId getDataNucleusIdentityForSingleFieldIdentity(SingleFieldIdentity sfid) { if (sfid instanceof javax.jdo.identity.LongIdentity) { return new LongId(sfid.getTargetClass(), sfid.toString()); } else if (sfid instanceof javax.jdo.identity.IntIdentity) { return new IntId(sfid.getTargetClass(), sfid.toString()); } else if (sfid instanceof javax.jdo.identity.ShortIdentity) { return new ShortId(sfid.getTargetClass(), sfid.toString()); } else if (sfid instanceof javax.jdo.identity.ByteIdentity) { return new ByteId(sfid.getTargetClass(), sfid.toString()); } else if (sfid instanceof javax.jdo.identity.StringIdentity) { return new StringId(sfid.getTargetClass(), sfid.toString()); } else if (sfid instanceof javax.jdo.identity.CharIdentity) { return new CharId(sfid.getTargetClass(), sfid.toString()); } return new ObjectId(sfid.getTargetClass(), sfid.getKeyAsObject()); }
JavaTypeMapping m = dba.getMapping(((SingleFieldIdentity)value).getTargetClass(), storeMgr, clr); ScalarExpression oidExpr = m.newLiteral(qs, ((SingleFieldIdentity)value).getKeyAsObject()); bExpr = expr.expressionList.getExpression(0).eq(oidExpr);