/** * Return the hashcode of the name, because it is fairly unique. */ public int hashCode() { return getName().hashCode(); }
/** * PUBLIC: * Return the database column or query parameter to partition queries by. * This is the table column name, not the class attribute name. * The column value must be included in the query and should normally be part of the object's Id. * This can also be the name of a query parameter. * If a query does not contain the field the query will not be partitioned. */ public String getPartitionFieldName() { return getPartitionField().getName(); }
/** * PUBLIC: * Return the name of the field this mapping represents. */ public String getFieldName() { return getField().getName(); }
/** * INTERNAL: * Convert a DatabaseField to an XMLField */ protected XMLField convertToXMLField(DatabaseField databaseField) { try { return (XMLField)databaseField; } catch (ClassCastException ex) { return new XMLField(databaseField.getName()); } }
/** * INTERNAL: * Return all the tenant id fields. */ public void addTenantDiscriminatorField(String property, DatabaseField field) { super.addTenantDiscriminatorField(property, field); // TODO: we could check for multiple different vpdIdentifiers for the // same policy. Right now, last one in partly wins (i.e. unless another // class sets a vpd identifier different then the last one in here). vpdIdentifier = property; vpdIdentifierFieldName = field.getName(); }
/** * INTERNAL: * Invoke the buildFieldValue on the appropriate FieldTransformer */ protected Object invokeFieldTransformer(DatabaseField field, FieldTransformer transformer, Object domainObject, AbstractSession session) throws DescriptorException { return transformer.buildFieldValue(domainObject, field.getName(), session); }
/** * Get the XPath String * @return String the XPath String associated with this Mapping * */ public String getXPath() { return getField().getName(); }
/** * PUBLIC: * Return the name of the field mapped by the mapping. */ public String getFieldName() { return this.getField().getName(); }
/** * INTERNAL: * Return all the tenant id fields. */ public void addTenantDiscriminatorField(String property, DatabaseField field) { super.addTenantDiscriminatorField(property, field); // TODO: we could check for multiple different vpdIdentifiers for the // same policy. Right now, last one in partly wins (i.e. unless another // class sets a vpd identifier different then the last one in here). vpdIdentifier = property; vpdIdentifierFieldName = field.getName(); }
/** * PUBLIC: * Return the name of the field that holds the nested collection. */ public String getFieldName() { return this.getField().getName(); }
/** * INTERNAL: * Method to return the primary key field name for this descriptor metadata. * It assumes there is one. */ public String getPrimaryKeyFieldName() { return getPrimaryKeyField().getName(); }
/** * PUBLIC: * Return the name of the field mapped by the mapping. */ public String getFieldName() { return this.getField().getName(); }
/** * INTERNAL: * Invoke the buildFieldValue on the appropriate FieldTransformer */ protected Object invokeFieldTransformer(DatabaseField field, FieldTransformer transformer, Object domainObject, AbstractSession session) throws DescriptorException { return transformer.buildFieldValue(domainObject, field.getName(), session); }
/** * PUBLIC: * Return the database column or query parameter to partition queries by. * This is the table column name, not the class attribute name. * The column value must be included in the query and should normally be part of the object's Id. * This can also be the name of a query parameter. * If a query does not contain the field the query will not be partitioned. */ public String getPartitionFieldName() { return getPartitionField().getName(); }
@Override public void addPrimaryKeyField(DatabaseField field) { if (!(field instanceof XMLField)) { String fieldName = field.getName(); field = new XMLField(fieldName); } if(null == primaryKeyFields) { primaryKeyFields = new ArrayList<DatabaseField>(1); } super.addPrimaryKeyField(field); }
/** * INTERNAL: * Go through this method if you can default a name. Provide the defaulting * context to log to the correct context message to the user. */ protected void setFieldName(DatabaseField field, String defaultName, String context) { setFieldName(field, getName(field.getName(), defaultName, context)); }
/** * INTERNAL: * Process index information for the given mapping. */ protected void processIndex() { if (m_index != null) { m_index.process(getDescriptor(), m_databaseField.getName()); } }
/** * INTERNAL: * Process cache index. */ protected void processCacheIndex() { if (m_cacheIndex != null) { m_cacheIndex.process(getDescriptor(), m_databaseField.getName()); } }
@Override public void addPrimaryKeyField(DatabaseField field) { if (!(field instanceof XMLField)) { String fieldName = field.getName(); field = new XMLField(fieldName); } super.addPrimaryKeyField(field); }
/** * PUBLIC: */ public String getEndFieldName() { if (getEnd() != null) { return getEnd().getName(); } else { return null; } }