/** * Method 'insert' * * @param dto * @return UiElementTypeAttributesPk */ @Transactional public UiElementTypeAttributesPk insert(UiElementTypeAttributes dto) { getJdbcTemplate() .update( "INSERT INTO " + getTableName() + " ( ATTRIBUTE_VALUE, UI_ELEMENT_TYPES_ID, ATTRIBUTES_ID ) VALUES ( ?, ?, ? )", dto.getAttributeValue(), dto.getUiElementTypesId(), dto.getAttributesId()); UiElementTypeAttributesPk pk = new UiElementTypeAttributesPk(); pk.setId(getJdbcTemplate().queryForInt("select last_insert_id()")); return pk; }
/** Updates a single row in the UI_ELEMENT_TYPE_ATTRIBUTES table. */ @Transactional public void update(UiElementTypeAttributesPk pk, UiElementTypeAttributes dto) { getJdbcTemplate() .update( "UPDATE " + getTableName() + " SET ID = ?, ATTRIBUTE_VALUE = ?, UI_ELEMENT_TYPES_ID = ?, ATTRIBUTES_ID = ? WHERE ID = ?", dto.getId(), dto.getAttributeValue(), dto.getUiElementTypesId(), dto.getAttributesId(), pk.getId()); }
/** Deletes a single row in the UI_ELEMENT_TYPE_ATTRIBUTES table. */ @Transactional public void delete(UiElementTypeAttributesPk pk) { getJdbcTemplate().update("DELETE FROM " + getTableName() + " WHERE ID = ?", pk.getId()); }
/** * Returns the rows from the UI_ELEMENT_TYPE_ATTRIBUTES table that matches the specified * primary-key value. */ public UiElementTypeAttributes findByPrimaryKey(UiElementTypeAttributesPk pk) { return findByPrimaryKey(pk.getId()); }