/** * INTERNAL: */ public void addMapping(DatabaseMapping mapping) { m_descriptor.addMapping(mapping); }
/** * PUBLIC: * Add a direct mapping to the receiver. The new mapping specifies that * an instance variable of the class of objects which the receiver describes maps in * the default manner for its type to the indicated database field. * * @param String instanceVariableName is the name of an instance variable of the * class which the receiver describes. * @param String fieldName is the name of the database column which corresponds * with the designated instance variable. * @return The newly created DatabaseMapping is returned. */ public DatabaseMapping addDirectMapping(String attributeName, String fieldName) { DirectToFieldMapping mapping = new DirectToFieldMapping(); mapping.setAttributeName(attributeName); mapping.setFieldName(fieldName); return addMapping(mapping); }
/** * PUBLIC: * Add a direct mapping to the receiver. The new mapping specifies that * a variable accessed by the get and set methods of the class of objects which * the receiver describes maps in the default manner for its type to the indicated * database field. */ public DatabaseMapping addDirectMapping(String attributeName, String getMethodName, String setMethodName, String fieldName) { DirectToFieldMapping mapping = new DirectToFieldMapping(); mapping.setAttributeName(attributeName); mapping.setSetMethodName(setMethodName); mapping.setGetMethodName(getMethodName); mapping.setFieldName(fieldName); return addMapping(mapping); }