/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
/** * Create a mapped Record from the ConnectionFactory's RecordFactory. * @param name record name * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createMappedRecord(String) */ public MappedRecord createMappedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createMappedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of mapped Record failed", ex); } }
/** * Create a mapped Record from the ConnectionFactory's RecordFactory. * @param name record name * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createMappedRecord(String) */ public MappedRecord createMappedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createMappedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of mapped Record failed", ex); } }
/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }
@Test public void testCreateMappedRecord() throws ResourceException { ConnectionFactory connectionFactory = mock(ConnectionFactory.class); RecordFactory recordFactory = mock(RecordFactory.class); MappedRecord mappedRecord = mock(MappedRecord.class); given(connectionFactory.getRecordFactory()).willReturn(recordFactory); given(recordFactory.createMappedRecord("name")).willReturn(mappedRecord); CciTemplate ct = new CciTemplate(connectionFactory); ct.createMappedRecord("name"); verify(recordFactory).createMappedRecord("name"); }
@Test public void testCreateIndexedRecord() throws ResourceException { ConnectionFactory connectionFactory = mock(ConnectionFactory.class); RecordFactory recordFactory = mock(RecordFactory.class); IndexedRecord indexedRecord = mock(IndexedRecord.class); given(connectionFactory.getRecordFactory()).willReturn(recordFactory); given(recordFactory.createIndexedRecord("name")).willReturn(indexedRecord); CciTemplate ct = new CciTemplate(connectionFactory); ct.createIndexedRecord("name"); verify(recordFactory).createIndexedRecord("name"); }
/** * Allow the platform to handle the creation of the DOM record. * By default create a mapped record an assume it implements DOM as well. */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createMappedRecord(recordName); } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Allow the platform to handle the creation of the DOM record. * Creates an indexed record (mapped records are not supported). */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createIndexedRecord(recordName); } catch (ResourceException exception) { throw EISException.createException(exception); } }
/** * Allow the platform to handle the creation of the DOM record. * By default create a mapped record an assume it implements DOM as well. */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createMappedRecord(recordName); } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Allow the platform to handle the creation of the DOM record. * Creates an indexed record (mapped records are not supported). */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createIndexedRecord(recordName); } catch (ResourceException exception) { throw EISException.createException(exception); } }
/** * Allow the platform to handle the creation of the DOM record. * By default create a mapped record an assume it implements DOM as well. */ public Record createDOMRecord(String recordName, EISAccessor accessor) { try { return accessor.getRecordFactory().createMappedRecord(recordName); } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
private void createIndexedRecord(String name) throws Exception { mockFactory.getMockConnectionFactory().getRecordFactory().createIndexedRecord(name); }
private void createMappedRecord(String name) throws Exception { mockFactory.getMockConnectionFactory().getRecordFactory().createMappedRecord(name); }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Create a mapped Record from the ConnectionFactory's RecordFactory. * @param name record name * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createMappedRecord(String) */ public MappedRecord createMappedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createMappedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of mapped Record failed", ex); } }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
/** * Create a mapped Record from the ConnectionFactory's RecordFactory. * @param name record name * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createMappedRecord(String) */ public MappedRecord createMappedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createMappedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of mapped Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of mapped Record failed", ex); } }
/** * Create an indexed input record for this interaction. * Populate the data into the record from this interaction's arguments. */ public Record createInputRecord(EISAccessor accessor) { try { IndexedRecord record = accessor.getRecordFactory().createIndexedRecord(getInputRecordName()); for (int index = 0; index < getParameters().size(); index++) { Object parameter = getParameters().get(index); // Allow conversion of nested rows and collections. record.add(createRecordElement("", parameter, accessor)); } return record; } catch (ResourceException exception) { throw EISException.resourceException(exception, accessor, null); } }
recordName = valuesRow.getFields().get(0).getTableName(); MappedRecord record = accessor.getRecordFactory().createMappedRecord(recordName); for (Iterator keysIterator = valuesRow.getFields().iterator(); keysIterator.hasNext();) {
/** * Create an indexed Record through the ConnectionFactory's RecordFactory. * @param name the name of the record * @return the Record * @throws DataAccessException if creation of the Record failed * @see #getRecordFactory(javax.resource.cci.ConnectionFactory) * @see javax.resource.cci.RecordFactory#createIndexedRecord(String) */ public IndexedRecord createIndexedRecord(String name) throws DataAccessException { try { RecordFactory recordFactory = getRecordFactory(obtainConnectionFactory()); return recordFactory.createIndexedRecord(name); } catch (NotSupportedException ex) { throw new RecordTypeNotSupportedException("Creation of indexed Record not supported by connector", ex); } catch (ResourceException ex) { throw new CannotCreateRecordException("Creation of indexed Record failed", ex); } }