Search in sources :

Example 1 with DefaultSelectTranslatorFactory

use of org.apache.cayenne.access.translator.select.DefaultSelectTranslatorFactory in project cayenne by apache.

the class SchemaBuilder method initNode.

private void initNode(DataMap map) throws Exception {
    DataNode node = new DataNode(map.getName());
    node.setJdbcEventLogger(jdbcEventLogger);
    node.setAdapter(dbAdapter);
    node.setDataSource(dataSourceFactory.getSharedDataSource());
    // setup test extended types
    node.getAdapter().getExtendedTypes().registerType(new StringET1ExtendedType());
    // tweak mapping with a delegate
    for (Procedure proc : map.getProcedures()) {
        unitDbAdapter.tweakProcedure(proc);
    }
    filterDataMap(map);
    node.addDataMap(map);
    node.setSchemaUpdateStrategy(new SkipSchemaUpdateStrategy());
    node.setRowReaderFactory(new DefaultRowReaderFactory());
    node.setBatchTranslatorFactory(new DefaultBatchTranslatorFactory());
    node.setSelectTranslatorFactory(new DefaultSelectTranslatorFactory());
    domain.addNode(node);
}
Also used : DefaultRowReaderFactory(org.apache.cayenne.access.jdbc.reader.DefaultRowReaderFactory) SkipSchemaUpdateStrategy(org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy) DefaultSelectTranslatorFactory(org.apache.cayenne.access.translator.select.DefaultSelectTranslatorFactory) DataNode(org.apache.cayenne.access.DataNode) StringET1ExtendedType(org.apache.cayenne.testdo.extended_type.StringET1ExtendedType) Procedure(org.apache.cayenne.map.Procedure) DefaultBatchTranslatorFactory(org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory)

Aggregations

DataNode (org.apache.cayenne.access.DataNode)1 SkipSchemaUpdateStrategy (org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy)1 DefaultRowReaderFactory (org.apache.cayenne.access.jdbc.reader.DefaultRowReaderFactory)1 DefaultBatchTranslatorFactory (org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory)1 DefaultSelectTranslatorFactory (org.apache.cayenne.access.translator.select.DefaultSelectTranslatorFactory)1 Procedure (org.apache.cayenne.map.Procedure)1 StringET1ExtendedType (org.apache.cayenne.testdo.extended_type.StringET1ExtendedType)1