public void useDefaultConstructorInstantiationPolicy() { setMethodName(null); setFactory(null); setFactoryClass(null); setFactoryClassName(null); setFactoryMethodName(null); }
/** * Build and return the default (zero-argument) constructor for the factory class. */ protected Constructor buildFactoryDefaultConstructor() throws DescriptorException { return this.buildDefaultConstructorFor(this.getFactoryClass()); }
/** * Build the row representation of the object for update. The row built does not * contain entries for uninstantiated attributes. */ public AbstractRecord buildRowForShallowInsert(Object object, AbstractSession session) { return buildRowForShallowInsert(createRecord(session), object, session); }
/** * Return the default (zero-argument) constructor for the descriptor class. */ protected Constructor getDefaultConstructor() throws DescriptorException { // Lazy initialize, because the constructor cannot be serialized if (defaultConstructor == null) { this.setDefaultConstructor(this.buildDefaultConstructor()); } return defaultConstructor; }
/** * INTERNAL: * Used to updated any attributes that may be cached on a woven entity */ public void updateCachedAttributes(PersistenceEntity persistenceEntity, CacheKey cacheKey, Object primaryKey){ persistenceEntity._persistence_setCacheKey(cacheKey); persistenceEntity._persistence_setId(primaryKey); }
/** * Create a new row/record for the object builder. This allows subclasses to * define different record types. This will typically be called when a * record will be used for temporarily holding on to primary key fields. */ protected AbstractRecord createRecordForPKExtraction(int size, AbstractSession session) { return createRecord(size, session); }
/** * Extract primary key attribute values from the domainObject. */ @Override public Object extractPrimaryKeyFromObject(Object domainObject, AbstractSession session) { return extractPrimaryKeyFromObject(domainObject, session, false); }
/** * Gets the value of an instance variable in the object. */ @Override public Object getAttributeValueFromObject(Object anObject) throws DescriptorException { return getAttributeValueFromObject(anObject, new Object[] {getAttributeName()}); }
/** * If no method name is specified, they we have to use the default (zero-argument) constructor. */ public boolean isUsingDefaultConstructor() { return this.getMethodName() == null; }
/** * Iterate a primitive object (String, Date, Integer, etc.). * Override this method if appropriate. */ protected void internalIteratePrimitive(Object primitiveValue) { iterate(primitiveValue); }
/** * INTERNAL: * Sets the instantiation policy. */ @Override public void setInstantiationPolicy(InstantiationPolicy instantiationPolicy) { this.instantiationPolicy = instantiationPolicy; if (instantiationPolicy != null) { instantiationPolicy.setDescriptor(this); } }
/** * INTERNAL: * Update the object primary key by fetching a new sequence number from the accessor. * This assume the uses sequence numbers check has already been done. * @return the sequence value or null if not assigned. * @exception DatabaseException - an error has occurred on the database. */ public Object assignSequenceNumber(Object object, AbstractSession writeSession) throws DatabaseException { return assignSequenceNumber(object, writeSession, null); }
/** * INTERNAL: */ public void setQueryKeyFields(Map<DatabaseField, DatabaseField> queryKeyFields) { setQueryKeyFields(queryKeyFields, true); }
/** * Set the descriptor. This method is overridden so the * isXMLDescriptor Boolean can be reset. */ public void setDescriptor(ClassDescriptor aDescriptor) { super.setDescriptor(aDescriptor); isXMLDescriptor = null; }
/** * Returns the value of the attribute on the specified object. */ public Object getAttributeValueFromObject(Object object) { return ((PersistenceObject)object)._persistence_get(this.attributeName); }
/** * INTERNAL: * Iterate on the specified element. */ @Override public void iterateOnElement(DescriptorIterator iterator, Object element) { iterator.iteratePrimitiveForMapping(element, this); }
/** * Convenience method to ensure converters have an opportunity to convert * any class names to classes during project setup. */ protected void convertConverterClassNamesToClasses(Converter converter, ClassLoader classLoader) { if (converter != null && converter instanceof ClassNameConversionRequired) { ((ClassNameConversionRequired)converter).convertClassNamesToClasses(classLoader); } }
/** * INTERNAL: */ @Override public Object getObjectValue(Object fieldValue, Session session) { return accessor.getValue(session); }
public void useFactoryInstantiationPolicy(Object factory, String methodName) { setMethodName(methodName); setFactory(factory); setFactoryClass(null); setFactoryClassName(null); setFactoryMethodName(null); }
/** * Iterate an aggregate object * (i.e. an object that is the target of an AggregateMapping). * Override this method if appropriate. */ protected void internalIterateAggregateObject(Object aggregateObject) { iterate(aggregateObject); }