public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must be set before calling this method. */ public void useMapClass(Class concreteContainerClass, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClass() == null) { throw DescriptorException.referenceClassNotSpecified(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteContainerClass); policy.setKeyName(methodName, getReferenceClass()); this.setContainerPolicy(policy); }
public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { AbstractSession session = writeQuery.getSession(); //Helper.toDo("bjv: need to figure out how to handle read-only elements..."); if (session.isClassReadOnly(this.getReferenceClass())) { return; } if (session.isUnitOfWork()) { if (this.compareObjects(writeQuery.getObject(), writeQuery.getBackupClone(), session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session); }
public void useMapClassName(String concreteContainerClassName, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } MapContainerPolicy policy = new MapContainerPolicy(concreteContainerClassName); policy.setKeyName(methodName, getReferenceClass().getName()); this.setContainerPolicy(policy); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { AbstractSession session = writeQuery.getSession(); //Helper.toDo("bjv: need to figure out how to handle read-only elements..."); if (session.isClassReadOnly(this.getReferenceClass())) { return; } if (session.isUnitOfWork()) { if (this.compareObjects(writeQuery.getObject(), writeQuery.getBackupClone(), session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session, WriteType.UPDATE); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must be set before calling this method. */ public void useMapClass(Class concreteContainerClass, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteContainerClass); policy.setKeyName(methodName, getReferenceClass()); this.setContainerPolicy(policy); }
/** * INTERNAL: * Get the attribute value from the object and add the changed * values to the specified database row. */ @Override public void writeFromObjectIntoRowForUpdate(WriteObjectQuery writeQuery, AbstractRecord row) throws DescriptorException { AbstractSession session = writeQuery.getSession(); //Helper.toDo("bjv: need to figure out how to handle read-only elements..."); if (session.isClassReadOnly(this.getReferenceClass())) { return; } if (session.isUnitOfWork()) { if (this.compareObjects(writeQuery.getObject(), writeQuery.getBackupClone(), session)) { return;// nothing has changed - don't put anything in the row } } this.writeFromObjectIntoRow(writeQuery.getObject(), row, session, WriteType.UPDATE); }
/** * PUBLIC: * Configure the mapping to use an instance of the specified container class * to hold the target objects. The key used to index the value in the Map * is the value returned by a call to the specified zero-argument method. * The method must be implemented by the class (or a superclass) of the * value to be inserted into the Map. * <p>jdk1.2.x: The container class must implement (directly or indirectly) the Map interface. * <p>jdk1.1.x: The container class must be a subclass of Hashtable. * <p>The referenceClass must be set before calling this method. */ public void useMapClass(Class concreteContainerClass, String methodName) { // the reference class has to be specified before coming here if (this.getReferenceClassName() == null) { throw DescriptorException.referenceClassNotSpecified(this); } ContainerPolicy policy = ContainerPolicy.buildPolicyFor(concreteContainerClass); policy.setKeyName(methodName, getReferenceClass()); this.setContainerPolicy(policy); }
if (session.isClassReadOnly(this.getReferenceClass())) { return null;