/** * @param dataAttributeId The ID of the Data Attribute belonging to this instance. * @param dataObjectInstanceId The ID of the Data Object Instance belonging to this instance. * @param dataObjectInstance The Data Object Instance belonging to this instance. */ public DataAttributeInstance( int dataAttributeId, int dataObjectInstanceId, DataObjectInstance dataObjectInstance) { this.dataAttributeId = dataAttributeId; this.dataObjectInstanceId = dataObjectInstanceId; this.dataObjectInstance = dataObjectInstance; this.type = dbDataAttributeInstance.getType(dataAttributeId); if (dbDataAttributeInstance.existDataAttributeInstance(dataAttributeId, dataObjectInstanceId)) { // creates an existing Attribute Instance using the database information this.dataAttributeInstanceId = dbDataAttributeInstance.getDataAttributeInstanceID(dataAttributeId, dataObjectInstanceId); } else { // creates a new Attribute Instance also in database this.dataAttributeInstanceId = dbDataAttributeInstance.createNewDataAttributeInstance( dataAttributeId, dataObjectInstanceId); } this.value = dbDataAttributeInstance.getValue(dataAttributeInstanceId); this.name = dbDataAttributeInstance.getName(dataAttributeId); }