@Override public String getId() { return objectId != null ? objectId.toString() : null; }
repository.connectionDelegate.getDatabase().closeInsert(); element.setId( elementId.toString() );
private void insertAttributes( List<IMetaStoreAttribute> children, LongObjectId elementId, LongObjectId parentAttributeId ) throws Exception { for ( IMetaStoreAttribute child : children ) { LongObjectId attributeId = repository.connectionDelegate.getNextID( quoteTable( KettleDatabaseRepository.TABLE_R_ELEMENT_ATTRIBUTE ), quote( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT_ATTRIBUTE ) ); RowMetaAndData table = new RowMetaAndData(); table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT_ATTRIBUTE ), attributeId.longValue() ); table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT ), elementId.longValue() ); table.addValue( new ValueMetaInteger( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_ID_ELEMENT_ATTRIBUTE_PARENT ), parentAttributeId.longValue() ); table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_KEY ), child.getId() ); table.addValue( new ValueMetaString( KettleDatabaseRepository.FIELD_ELEMENT_ATTRIBUTE_VALUE ), encodeAttributeValue( child.getValue() ) ); repository.connectionDelegate.getDatabase().prepareInsert( table.getRowMeta(), KettleDatabaseRepository.TABLE_R_ELEMENT_ATTRIBUTE ); repository.connectionDelegate.getDatabase().setValuesInsert( table ); repository.connectionDelegate.getDatabase().insertRow(); repository.connectionDelegate.getDatabase().closeInsert(); child.setId( attributeId.toString() ); } }