/** * INTERNAL: * Return true if read-only is explicitly set to true; * otherwise return whether the transformation has no fields * (no fields = read-only) */ @Override public boolean isReadOnly() { if (super.isReadOnly()) { return true; } else { return getFieldTransformations().isEmpty() && this.fieldToTransformers.isEmpty(); } }
/** * INTERNAL: * Return true if read-only is explicitly set to true; * otherwise return whether the transformation has no fields * (no fields = read-only) */ @Override public boolean isReadOnly() { if (super.isReadOnly()) { return true; } else { return getFieldTransformations().isEmpty() && this.fieldToTransformers.isEmpty(); } }
/** * INTERNAL: * Required for reverse compatibility and test cases: * @return a hash table containing the fieldName and their respective method names */ public Hashtable getFieldNameToMethodNames() { Hashtable table = new Hashtable(getFieldTransformations().size()); Iterator transformations = getFieldTransformations().iterator(); while (transformations.hasNext()) { FieldTransformation transformation = (FieldTransformation)transformations.next(); if (transformation instanceof MethodBasedFieldTransformation) { table.put(transformation.getField().getQualifiedName(), ((MethodBasedFieldTransformation)transformation).getMethodName()); } } return table; }
/** * INTERNAL: * Required for reverse compatibility and test cases: * @return a hash table containing the fieldName and their respective method names */ public Hashtable getFieldNameToMethodNames() { Hashtable table = new Hashtable(getFieldTransformations().size()); Iterator transformations = getFieldTransformations().iterator(); while (transformations.hasNext()) { FieldTransformation transformation = (FieldTransformation)transformations.next(); if (transformation instanceof MethodBasedFieldTransformation) { table.put(transformation.getField().getQualifiedName(), ((MethodBasedFieldTransformation)transformation).getMethodName()); } } return table; }
/** * INTERNAL: * Required for reverse compatibility and test cases: * @return a hash table containing the fieldName and their respective method names */ public Hashtable getFieldNameToMethodNames() { Hashtable table = new Hashtable(getFieldTransformations().size()); Iterator transformations = getFieldTransformations().iterator(); while (transformations.hasNext()) { FieldTransformation transformation = (FieldTransformation)transformations.next(); if (transformation instanceof MethodBasedFieldTransformation) { table.put(transformation.getField().getQualifiedName(), ((MethodBasedFieldTransformation)transformation).getMethodName()); } } return table; }
/** * PUBLIC: * Add the field and the transformer * that returns the value to be placed in the field * when the object is written to the database. */ public void addFieldTransformer(DatabaseField field, FieldTransformer transformer) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(transformer); transformation.setField(field); getFieldTransformations().add(transformation); }
/** * INTERNAL: * Return true if read-only is explicitly set to true; * otherwise return whether the transformation has no fields * (no fields = read-only) */ public boolean isReadOnly() { if (super.isReadOnly()) { return true; } else { return getFieldTransformations().isEmpty() && getFieldToTransformers().isEmpty(); } }
/** * PUBLIC: * Add the field and the transformer * that returns the value to be placed in the field * when the object is written to the database. */ public void addFieldTransformer(DatabaseField field, FieldTransformer transformer) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(transformer); transformation.setField(field); getFieldTransformations().add(transformation); }
/** * PUBLIC: * Add the field and the transformer * that returns the value to be placed in the field * when the object is written to the database. */ public void addFieldTransformer(DatabaseField field, FieldTransformer transformer) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(transformer); transformation.setField(field); getFieldTransformations().addElement(transformation); }
/** * INTERNAL: * Add the name of a field and the name of a class which implements * the FieldTransformer interface. When the object is written, the transform * method will be called on the FieldTransformer to acquire the value to put * in the field. */ public void addFieldTransformerClassName(DatabaseField field, String className) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(); transformation.setField(field); transformation.setTransformerClassName(className); getFieldTransformations().add(transformation); }
/** * INTERNAL: * Add the name of a field and the name of a class which implements * the FieldTransformer interface. When the object is written, the transform * method will be called on the FieldTransformer to acquire the value to put * in the field. */ public void addFieldTransformerClassName(DatabaseField field, String className) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(); transformation.setField(field); transformation.setTransformerClassName(className); getFieldTransformations().addElement(transformation); }
/** * INTERNAL: * Add the name of a field and the name of a class which implements * the FieldTransformer interface. When the object is written, the transform * method will be called on the FieldTransformer to acquire the value to put * in the field. */ public void addFieldTransformerClassName(DatabaseField field, String className) { TransformerBasedFieldTransformation transformation = new TransformerBasedFieldTransformation(); transformation.setField(field); transformation.setTransformerClassName(className); getFieldTransformations().add(transformation); }
/** * PUBLIC: * Add the field and the name of the method * that returns the value to be placed in said field * when the object is written to the database. * The method may take zero arguments, or it may * take a single argument of type * <code>org.eclipse.persistence.sessions.Session</code>. */ public void addFieldTransformation(DatabaseField field, String methodName) { MethodBasedFieldTransformation transformation = new MethodBasedFieldTransformation(); transformation.setField(field); transformation.setMethodName(methodName); getFieldTransformations().add(transformation); }
/** * PUBLIC: * Add the field and the name of the method * that returns the value to be placed in said field * when the object is written to the database. * The method may take zero arguments, or it may * take a single argument of type * <code>org.eclipse.persistence.sessions.Session</code>. */ public void addFieldTransformation(DatabaseField field, String methodName) { MethodBasedFieldTransformation transformation = new MethodBasedFieldTransformation(); transformation.setField(field); transformation.setMethodName(methodName); getFieldTransformations().add(transformation); }
/** * PUBLIC: * Add the field and the name of the method * that returns the value to be placed in said field * when the object is written to the database. * The method may take zero arguments, or it may * take a single argument of type * <code>org.eclipse.persistence.sessions.Session</code>. */ public void addFieldTransformation(DatabaseField field, String methodName) { MethodBasedFieldTransformation transformation = new MethodBasedFieldTransformation(); transformation.setField(field); transformation.setMethodName(methodName); getFieldTransformations().addElement(transformation); }
/** * INTERNAL: * Needed for backwards compatibility */ public Vector getFieldNameToMethodNameAssociations() { Vector associations = new Vector(); for (Iterator source = getFieldTransformations().iterator(); source.hasNext();) { FieldTransformation tf = (FieldTransformation)source.next(); if (tf instanceof MethodBasedFieldTransformation) { Association ass = new Association(); ass.setKey(tf.getField().getQualifiedName()); ass.setValue(((MethodBasedFieldTransformation)tf).getMethodName()); associations.addElement(ass); } } return associations; }
/** * INTERNAL: * Needed for backwards compatibility */ public Vector getFieldNameToMethodNameAssociations() { Vector associations = new Vector(); for (Iterator source = getFieldTransformations().iterator(); source.hasNext();) { FieldTransformation tf = (FieldTransformation)source.next(); if (tf instanceof MethodBasedFieldTransformation) { Association ass = new Association(); ass.setKey(tf.getField().getQualifiedName()); ass.setValue(((MethodBasedFieldTransformation)tf).getMethodName()); associations.addElement(ass); } } return associations; }
/** * INTERNAL: * needed for backwards compatibility */ public void setFieldNameToMethodNameAssociations(Vector associations) { setFieldTransformations(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(associations.size())); for (Iterator source = associations.iterator(); source.hasNext();) { Association ass = (Association)source.next(); MethodBasedFieldTransformation tf = new MethodBasedFieldTransformation(); tf.setField(new DatabaseField((String)ass.getKey())); tf.setMethodName((String)ass.getValue()); getFieldTransformations().add(tf); } }
/** * INTERNAL: * needed for backwards compatibility */ public void setFieldNameToMethodNameAssociations(Vector associations) { setFieldTransformations(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(associations.size())); for (Iterator source = associations.iterator(); source.hasNext();) { Association ass = (Association)source.next(); MethodBasedFieldTransformation tf = new MethodBasedFieldTransformation(); tf.setField(new DatabaseField((String)ass.getKey())); tf.setMethodName((String)ass.getValue()); getFieldTransformations().add(tf); } }
/** * INTERNAL: * needed for backwards compatibility */ public void setFieldNameToMethodNameAssociations(Vector associations) { setFieldTransformations(org.eclipse.persistence.internal.helper.NonSynchronizedVector.newInstance(associations.size())); for (Iterator source = associations.iterator(); source.hasNext();) { Association ass = (Association)source.next(); MethodBasedFieldTransformation tf = new MethodBasedFieldTransformation(); tf.setField(new DatabaseField((String)ass.getKey())); tf.setMethodName((String)ass.getValue()); getFieldTransformations().addElement(tf); } }