public void useMethodInstantiationPolicy(String staticMethodName) { setMethodName(staticMethodName); setFactory(null); setFactoryClass(null); setFactoryClassName(null); setFactoryMethodName(null); } }
/** * 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(), object, session); }
/** * Build the row representation of an object. */ public AbstractRecord buildRowWithChangeSet(ObjectChangeSet objectChangeSet, AbstractSession session) { return buildRowWithChangeSet(createRecord(), objectChangeSet, session); }
/** * Build and return a new instance, using the appropriate mechanism. */ public Object buildNewInstance() throws DescriptorException { if (this.isUsingDefaultConstructor()) { return this.buildNewInstanceUsingDefaultConstructor(); } else { return this.buildNewInstanceUsingFactory(); } }
/** * Returns the class type of the attribute. */ public Class getAttributeClass() { if (getAttributeField() == null) { return null; } return getAttributeType(); }
/** * Build the primary key expression from the specified domain object. */ public Expression buildPrimaryKeyExpressionFromObject(Object domainObject, AbstractSession session) { return buildPrimaryKeyExpressionFromKeys(extractPrimaryKeyFromObject(domainObject, session), session); }
/** * Build the row representation of an object. */ public AbstractRecord buildRow(Object object, AbstractSession session) { return buildRow(createRecord(), object, session); }
/** * Build the row representation of the object for update. The row built does not * contain entries for uninstantiated attributes. */ public AbstractRecord buildRowForShallowInsertWithChangeSet(ObjectChangeSet objectChangeSet, AbstractSession session) { return buildRowForShallowInsertWithChangeSet(createRecord(), objectChangeSet, 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; }
/** * Build and return the default (zero-argument) constructor for the factory class. */ protected Constructor buildFactoryDefaultConstructor() throws DescriptorException { return this.buildDefaultConstructorFor(this.getFactoryClass()); }
/** * Return the return type of the method accessor. */ public Class getAttributeClass() { if (getGetMethod() == null) { return null; } return getGetMethodReturnType(); }
/** * Return a new instance of the receiver's javaClass. */ public Object buildNewInstance() { return getDescriptor().getInstantiationPolicy().buildNewInstance(); }
/** * Iterate a value holder. * Override this method if appropriate. */ protected void internalIterateValueHolder(ValueHolderInterface valueHolder) { iterate(valueHolder); }
/** * INTERNAL: * Iterate on the specified element. */ public void iterateOnElement(DescriptorIterator iterator, Object element) { iterator.iteratePrimitiveForMapping(element, this); }
/** * PUBLIC: * Default constructor. */ public DatabaseMapping() { this.isOptional = true; this.isReadOnly = false; this.attributeAccessor = new InstanceVariableAttributeAccessor(); }
/** * If no method name is specified, they we have to use the default (zero-argument) constructor. */ public boolean isUsingDefaultConstructor() { return this.getMethodName() == null; }
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); }
public void useFactoryInstantiationPolicy(String factoryClassName, String methodName) { setMethodName(methodName); setFactory(null); setFactoryClass(null); setFactoryClassName(factoryClassName); setFactoryMethodName(null); }
/** * Iterate an indirect container (IndirectList or IndirectMap). * Override this method if appropriate. */ protected void internalIterateIndirectContainer(IndirectContainer container) { iterate(container); }