public String getName() { return cmd.getEntityName(); }
/** * * Returns the name of the entity, first checking the name attribute of the annotations and then * defaulting to the entity name on the metadata object. * * @param acmd the metadata object of the JPA entity * @return the name of the entity to use in JPA (entity name or JPQL queries) */ public static String getEntityName(AbstractClassMetaData acmd) { Map<String, String> extensions = getForceExtensions(acmd); String name = extensions.get("name") != null ? extensions.get("name") : acmd.getEntityName(); return name != null ? name : acmd.getName(); }
/** * * Returns the name of the entity, first checking the name attribute of the annotations and then * defaulting to the entity name on the metadata object. * * @param acmd the metadata object of the JPA entity * @return the name of the entity to use in JPA (entity name or JPQL queries) */ public static String getEntityName(AbstractClassMetaData acmd) { Map<String, String> extensions = getForceExtensions(acmd); String name = extensions.get("name") != null ? extensions.get("name") : acmd.getEntityName(); return name != null ? name : acmd.getName(); }
private static String getForceApiRelationshipName(AbstractMemberMetaData ammd, Map<String, String> extensions, OMFContext omf) { AbstractClassMetaData acmd = PersistenceUtils.getMemberElementClassMetaData(ammd, omf.getClassLoaderResolver(null), omf.getMetaDataManager()); AbstractMemberMetaData mmd = acmd.getMetaDataForMember(ammd.getMappedBy()); if (mmd == null) { // The mappedBy field does not exist throw new NucleusUserException("Cannot access mappedBy field " + ammd.getMappedBy() + " on entity " + acmd.getName() + " at " + ammd.getFullFieldName()); } String tableName = acmd.getEntityName(); String fieldNameNoSuffix = getFieldName(mmd, extensions); extensions = getForceExtensions(mmd); String childRelationshipName = extensions.get("childRelationshipName"); String relationshipName = childRelationshipName != null ? childRelationshipName : String.format("%s_%ss", fieldNameNoSuffix, tableName); if (relationshipName.length() > 40) { relationshipName = relationshipName.substring(0, 40); } return relationshipName; }
private static String getForceApiRelationshipName(AbstractMemberMetaData ammd, Map<String, String> extensions, OMFContext omf) { AbstractClassMetaData acmd = PersistenceUtils.getMemberElementClassMetaData(ammd, omf.getClassLoaderResolver(null), omf.getMetaDataManager()); AbstractMemberMetaData mmd = acmd.getMetaDataForMember(ammd.getMappedBy()); if (mmd == null) { // The mappedBy field does not exist throw new NucleusUserException("Cannot access mappedBy field " + ammd.getMappedBy() + " on entity " + acmd.getName() + " at " + ammd.getFullFieldName()); } String tableName = acmd.getEntityName(); String fieldNameNoSuffix = getFieldName(mmd, extensions); extensions = getForceExtensions(mmd); String childRelationshipName = extensions.get("childRelationshipName"); String relationshipName = childRelationshipName != null ? childRelationshipName : String.format("%s_%ss", fieldNameNoSuffix, tableName); if (relationshipName.length() > 40) { relationshipName = relationshipName.substring(0, 40); } return relationshipName; }
if (cmd.getEntityName() != null) identifierName = cmd.getEntityName();
this.table = storeManager.getTable(acmd); if (this.table == null) { throw new NucleusUserException("Entity does not exist in Force.com datastore: " + acmd.getEntityName());
this.table = storeManager.getTable(acmd); if (this.table == null) { throw new NucleusUserException("Entity does not exist in Force.com datastore: " + acmd.getEntityName());
identifierName = mmd.getAbstractClassMetaData().getEntityName() + getWordSeparator() + mmd.getName();