/** * Return the fields handled by the mapping. */ protected Vector collectFields() { Vector fields = new Vector(1); fields.addElement(this.getField()); return fields; }
/** * PUBLIC: * Checks whether the mapping uses a single node. * * @return True if the items in the collection are in a single node or false if each of the items in the collection is in its own node. */ public boolean usesSingleNode() { if (getField() instanceof Field) { return ((Field)getField()).usesSingleNode(); } return false; }
/** * Return the fields handled by the mapping. */ protected Vector collectFields() { Vector fields = new Vector(1); fields.addElement(this.getField()); return fields; }
/** * Return the fields handled by the mapping. */ protected Vector collectFields() { Vector fields = new Vector(1); fields.addElement(this.getField()); return fields; }
/** * PUBLIC: * Checks whether the mapping uses a single node. * * @returns True if the items in the collection are in a single node or false if each of the items in the collection is in its own node. */ public boolean usesSingleNode() { if (getField() instanceof XMLField) { return ((XMLField)getField()).usesSingleNode(); } return false; }
/** * PUBLIC: * Sets whether the mapping uses a single node. * @param usesSingleNode true if the items in the collection are in a single node or false if each of the items in the collection is in its own node */ public void setUsesSingleNode(boolean usesSingleNode) { if (getField() instanceof Field) { ((Field)getField()).setUsesSingleNode(usesSingleNode); } }
/** * PUBLIC: * Sets whether the mapping uses a single node. * @param True if the items in the collection are in a single node or false if each of the items in the collection is in its own node */ public void setUsesSingleNode(boolean usesSingleNode) { if (getField() instanceof XMLField) { ((XMLField)getField()).setUsesSingleNode(usesSingleNode); } }
/** * PUBLIC: * Sets whether the mapping uses a single node. * @param usesSingleNode true if the items in the collection are in a single node or false if each of the items in the collection is in its own node */ public void setUsesSingleNode(boolean usesSingleNode) { if (getField() instanceof Field) { ((Field)getField()).setUsesSingleNode(usesSingleNode); } }
/** * PUBLIC: * Checks whether the mapping uses a single node. * * @return True if the items in the collection are in a single node or false if each of the items in the collection is in its own node. */ public boolean usesSingleNode() { if (getField() instanceof Field) { return ((Field)getField()).usesSingleNode(); } return false; }
/** * PUBLIC: * Return the name of the field that holds the nested collection. */ public String getFieldName() { return this.getField().getName(); }
/** * PUBLIC: * Return the name of the field that holds the nested collection. */ public String getFieldName() { return this.getField().getName(); }
/** * PUBLIC: * Return the name of the field that holds the nested collection. */ public String getFieldName() { return this.getField().getName(); }
/** * INTERNAL: * Write the fields needed for insert into the template with null values. */ public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) { if (this.isReadOnly()) { return; } row.put(this.getField(), null); }
/** * INTERNAL: * Write the fields needed for insert into the template with null values. */ public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) { if (this.isReadOnly()) { return; } row.put(this.getField(), null); }
/** * INTERNAL: * Write the fields needed for insert into the template with null values. */ public void writeInsertFieldsIntoRow(AbstractRecord row, AbstractSession session) { if (this.isReadOnly()) { return; } row.put(this.getField(), null); }
/** * INTERNAL * Called when a DatabaseMapping is used to map the key in a collection. Returns the key. */ public Object createMapComponentFromRow(AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected){ Object key = dbRow.get(getField()); if (getValueConverter() != null){ key = getValueConverter().convertDataValueToObjectValue(key, session); } return key; }
/** * INTERNAL * Called when a DatabaseMapping is used to map the key in a collection. Returns the key. */ public Object createMapComponentFromRow(AbstractRecord dbRow, ObjectBuildingQuery query, CacheKey parentCacheKey, AbstractSession session, boolean isTargetProtected){ Object key = dbRow.get(getField()); if (getValueConverter() != null){ key = getValueConverter().convertDataValueToObjectValue(key, session); } return key; }
/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); if (getValueConverter() != null) { getValueConverter().initialize(this, session); } }
/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); if (getValueConverter() != null) { getValueConverter().initialize(this, session); } }
/** * INTERNAL: * Initialize the mapping. */ public void initialize(AbstractSession session) throws DescriptorException { super.initialize(session); if (getField() == null) { throw DescriptorException.fieldNameNotSetInMapping(this); } setField(getDescriptor().buildField(getField())); setFields(collectFields()); if (getValueConverter() != null) { getValueConverter().initialize(this, session); } }