/** * Build the row representation of an object. */ public AbstractRecord buildRow(Object object, AbstractSession session) { return buildRow(createRecord(), object, session); }
return getObjectBuilder(attributeValue, query.getSession()).buildRow(attributeValue, query.getSession()); } else { if (query.getSession().isClassReadOnly(attributeValue.getClass())) {
if (modifyRow == null) {// Maybe have been passed in as in aggregate collection. if (writeQuery.shouldCascadeParts()) { writeQuery.setModifyRow(getDescriptor().getObjectBuilder().buildRow(object, getSession())); } else { writeQuery.setModifyRow(getDescriptor().getObjectBuilder().buildRowForShallowInsert(object, getSession())); writeQuery.setModifyRow(getDescriptor().getObjectBuilder().buildRow(modifyRow, object, getSession())); } else { writeQuery.setModifyRow(getDescriptor().getObjectBuilder().buildRowForShallowInsert(modifyRow, object, getSession()));
writeQuery.setModifyRow(getDescriptor().getObjectBuilder().buildRow(object, getSession()));
/** * INTERNAL: * return the aggregate databaseRow with the primary keys from the source table and targer table */ public AbstractRecord getAggregateRow(ObjectLevelModifyQuery query, Object object) { Vector referenceObjectKeys = getReferenceObjectKeys(query); AbstractRecord aggregateRow = new DatabaseRecord(); Vector keys = getTargetForeignKeyFields(); for (int keyIndex = 0; keyIndex < keys.size(); keyIndex++) { aggregateRow.put(keys.elementAt(keyIndex), referenceObjectKeys.elementAt(keyIndex)); } getReferenceDescriptor(object.getClass(), query.getSession()).getObjectBuilder().buildRow(aggregateRow, object, query.getSession()); return aggregateRow; }
/** * INTERNAL: * Build and return a database row built with the values from * the specified attribute value. */ protected AbstractRecord buildRowFromAggregate(Object object, Object attributeValue, AbstractSession session, boolean forceWriteOfReadOnlyClasses) throws DescriptorException { if (attributeValue == null) { if (isNullAllowed()) { return buildNullReferenceRow(); } else { throw DescriptorException.nullForNonNullAggregate(object, this); } } else { if ((!forceWriteOfReadOnlyClasses) && (session.isClassReadOnly(attributeValue.getClass()))) { return new DatabaseRecord(1); } else { return getObjectBuilder(attributeValue, session).buildRow(attributeValue, session); } } }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { DeleteObjectQuery customDeleteQuery = (DeleteObjectQuery)customQuery; customDeleteQuery.setObject(getObject()); customDeleteQuery.setObjectChangeSet(getObjectChangeSet()); customDeleteQuery.setCascadePolicy(getCascadePolicy()); customDeleteQuery.setShouldMaintainCache(shouldMaintainCache()); customDeleteQuery.setTranslationRow(customDeleteQuery.getDescriptor().getObjectBuilder().buildRow(getObject(), customDeleteQuery.getSession())); }