public String toString() { if (mmd != null) { return "SQLTableMapping: tbl=" + table + " class=" + (cmd != null ? cmd.getFullClassName() : "null") + " mapping=" + mapping + " member=" + mmd.getFullFieldName(); } return "SQLTableMapping: tbl=" + table + " class=" + (cmd != null ? cmd.getFullClassName() : "null") + " mapping=" + mapping; } }
/** * Accessor for the element type stored in this Collection/Set/List. * @return Name of element type. */ public String getElementType() { return mmd.getCollection().getElementType(); }
/** * Accessor for whether the value is a persistable(serialised) * @return Whether the value is PC and is serialised */ public boolean isSerialisedValuePC() { if (mmd.getMap() != null && mmd.getMap().isSerializedValue() && mmd.getMap().valueIsPersistent()) { return true; } return false; }
protected String getTypeNameForField(AbstractMemberMetaData mmd) { AbstractClassMetaData fieldCmd = classEnhancer.getMetaDataManager().getMetaDataForClass(mmd.getType(), classEnhancer.getClassLoaderResolver()); String fieldTypeName = mmd.getTypeName(); if (fieldCmd != null && fieldCmd.getIdentityType() == IdentityType.APPLICATION) { fieldTypeName = fieldCmd.getObjectidClass(); } return fieldTypeName; }
public AbstractMemberMetaData getRealMemberMetaData() { if (mmd.getParent() instanceof EmbeddedMetaData) { // Get the real owner classMetaData (when embedded the cmd is often the embedded) AbstractClassMetaData cmd = storeMgr.getMetaDataManager().getMetaDataForClass(mmd.getClassName(), clr); return cmd.getMetaDataForMember(mmd.getName()); } return mmd; } }
public void loaded(AbstractClassMetaData cmd) { if (cmd.getIdentityType() == IdentityType.DATASTORE && !cmd.isEmbeddedOnly()) { // Datastore id not supported throw new InvalidClassMetaDataException("LDAP.DatastoreID", cmd.getFullClassName()); } } }
/** * Initialize this JavaTypeMapping with the given DatastoreAdapter for * the given FieldMetaData. * @param table The datastore container storing this mapping (if any) * @param clr the ClassLoaderResolver * @param fmd FieldMetaData for the field to be mapped (if any) */ public void initialize(AbstractMemberMetaData fmd, Table table, ClassLoaderResolver clr) { initialize(fmd, table, clr, fmd.getElementMetaData().getEmbeddedMetaData(), fmd.getCollection().getElementType(), ObjectProvider.EMBEDDED_COLLECTION_ELEMENT_PC); } }
public boolean isVersion() { VersionMetaData vermd = mmd.getAbstractClassMetaData().getVersionMetaData(); if (vermd.getFieldName() != null && vermd.getFieldName().equals(mmd.getName())) { return true; } return false; }
/** * Initialize this JavaTypeMapping with the given DatastoreAdapter for the given metadata. * @param table The datastore container storing this mapping (if any) * @param clr the ClassLoaderResolver * @param fmd FieldMetaData for the field to be mapped (if any) */ public void initialize(AbstractMemberMetaData fmd, Table table, ClassLoaderResolver clr) { initialize(fmd, table, clr, fmd.getKeyMetaData().getEmbeddedMetaData(), fmd.getMap().getKeyType(), ObjectProvider.EMBEDDED_MAP_KEY_PC); } }
/** * Accessor for whether the key is a persistable(serialised) * @return Whether the key is PC and is serialised */ public boolean isSerialisedKeyPC() { if (mmd.getMap() != null && mmd.getMap().isSerializedKey() && mmd.getMap().keyIsPersistent()) { return true; } return false; }
/** * Accessor for the value type for this Map. * @return Name of value type. */ public String getValueType() { return mmd.getMap().getValueType(); }
/** * Accessor for the key type for this Map. * @return Name of key type. */ public String getKeyType() { return mmd.getMap().getKeyType(); }
/** * Accessor for whether the element is serialised into this table. * This can be a serialised persistable, or a serialised simple type * @return Whether the element is serialised. */ public boolean isSerialisedElement() { if (mmd.getCollection() != null && mmd.getCollection().isSerializedElement()) { return true; } return false; }
/** * Accessor for whether the key is serialised into this table. * This can be an serialised persistable, or a serialised simple type. * @return Whether the key is serialised. */ public boolean isSerialisedKey() { if (mmd.getMap() != null && mmd.getMap().isSerializedKey()) { return true; } return false; }
/** * Accessor for whether the element is a persistable(serialised) * @return Whether the element is PC and is serialised */ public boolean isSerialisedElementPC() { if (mmd.getArray() != null && mmd.getArray().isSerializedElement()) { return true; } return false; }
public static boolean isNewOrSuperclassTableInheritanceStrategy(AbstractClassMetaData cmd) { while (cmd != null) { AbstractClassMetaData pcmd = cmd.getSuperAbstractClassMetaData(); if (pcmd == null) { return cmd.getInheritanceMetaData().getStrategy() == InheritanceStrategy.NEW_TABLE; } else if (cmd.getInheritanceMetaData().getStrategy() != InheritanceStrategy.SUPERCLASS_TABLE) { return false; } cmd = pcmd; } return false; }
public boolean isOptional() // Really wants to know if it is nullable { return mmd.getColumnMetaData() != null && mmd.getColumnMetaData()[0].isAllowsNull(); }
/** * * Returns whether an entity has no schema. * An entity does not have schema if it would not directly represent an object in Force.com; * for example, if the entity is embedded or if it's a subclass of another entity * * @param acmd the metadata object of the JPA entity * @return {@code true} if the entity does not have schema */ public static boolean hasNoSchema(AbstractClassMetaData acmd) { return acmd.isEmbeddedOnly() || acmd.getInheritanceMetaData() != null && acmd.getInheritanceMetaData().getStrategy() == InheritanceStrategy.SUBCLASS_TABLE; }
public void loaded(AbstractClassMetaData cmd) { if (cmd.getIdentityType() == IdentityType.DATASTORE && !cmd.isEmbeddedOnly()) { // Datastore id not supported throw new InvalidClassMetaDataException("XML.DatastoreID", cmd.getFullClassName()); } } }
/** * Accessor for whether the element is serialised into this table. * This can be a serialised persistable, or a serialised simple type * @return Whether the element is serialised. */ public boolean isSerialisedElement() { if (mmd.getArray() != null && mmd.getArray().isSerializedElement()) { return true; } return false; }