@Override public List<String> performInsert( InsertOperation insert ) throws MetadataStoreException, MetadataInspectorException { List<String> identifierList = new ArrayList<String>(); for ( MetadataRecord record : insert.getRecords() ) { if ( record != null ) { // TODO: suppor of other registryObjects RegistryPackage ebrimRecord = new RegistryPackage( record.getAsOMElement() ); // TODO: inspect records insert( ebrimRecord ); identifierList.add( ebrimRecord.getIdentifier() ); } } return identifierList; }
@Override public List<String> performInsert( InsertOperation insert ) throws MetadataStoreException, MetadataInspectorException { List<? extends MetadataRecord> recordsToInsert = insert.getRecords(); List<String> insertedIds = new ArrayList<String>( recordsToInsert.size() ); for ( MetadataRecord record : recordsToInsert ) { ISORecord isoRecord = (ISORecord) record; if ( storedRecords.contains( isoRecord ) ) { throw new MetadataStoreException( "Insert failed: record with identifier " + record.getIdentifier() + " exists." ); } transactionCandidates.add( new TransactionCandidate( TransactionStatus.INSERT, isoRecord.getIdentifier(), isoRecord ) ); insertedIds.add( isoRecord.getIdentifier() ); } return insertedIds; }
@Override public List<String> performInsert( InsertOperation insert ) throws MetadataStoreException, MetadataInspectorException { List<String> identifierList = new ArrayList<String>(); for ( MetadataRecord record : insert.getRecords() ) { try { for ( RecordInspector<ISORecord> r : inspectors ) { record = r.inspect( (ISORecord) record, conn, dialect ); } if ( record != null ) { ISORecord rec = new ISORecord( record.getAsOMElement() ); TransactionService transactionService = getTransactionalSqlService(); transactionService.executeInsert( conn, rec ); identifierList.add( rec.getIdentifier() ); } } catch ( XMLStreamException e ) { e.printStackTrace(); throw new MetadataStoreException( "Error on insert: " + e.getMessage(), e ); } } return identifierList; }