Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.DataMap


                continue;
            }

            // skip FK to a different DB
            if (domain != null) {
                DataMap srcMap = rel.getSourceEntity().getDataMap();
                DataMap targetMap = rel.getTargetEntity().getDataMap();

                if (srcMap != null && targetMap != null && srcMap != targetMap) {
                    if (domain.lookupDataNode(srcMap) != domain.lookupDataNode(targetMap)) {
                        continue;
                    }
View Full Code Here


    /**
     * Removes named DataMap from this DataDomain and any underlying DataNodes that
     * include it.
     */
    public synchronized void removeMap(String mapName) {
        DataMap map = getMap(mapName);
        if (map == null) {
            return;
        }

        // remove from data nodes
View Full Code Here

    settings.load();

    // Get the Cayenne map
    DataDomain domain = Configuration.getSharedConfiguration().getDomain("BNUBotDomain");
    DataNode dataNode = domain.getNode("BNUBotDataNode");
    DataMap dataMap = domain.getMap("BNUBotMap");

    DataSource dataSource = dataNode.getDataSource();
    DbAdapter adapter = dataNode.getAdapter();

    try {
View Full Code Here

    protected DbAdapter adapter;

    public DBHelper get() throws ConfigurationException {

        DataChannel channel = serverRuntimeProvider.get().getChannel();
        DataMap firstMap = channel.getEntityResolver().getDataMaps().iterator().next();
        return new FlavoredDBHelper(dataSource, adapter.getQuotingStrategy(firstMap
                .isQuotingSQLIdentifiers()));
    }
View Full Code Here

    public void testAdapter() throws Exception {
        assertSame(getNode().getAdapter(), gen.getAdapter());
    }

    public void testPkFilteringLogic() throws Exception {
        DataMap map = getDomain().getDataMap("testmap");
        DbEntity artistExhibit = map.getDbEntity("ARTIST_EXHIBIT");
        DbEntity exhibit = map.getDbEntity("EXHIBIT");

        // sanity check
        assertNotNull(artistExhibit);
        assertNotNull(exhibit);
        assertNotNull(gen.dbEntitiesRequiringAutoPK);
View Full Code Here

    public void testDBGeneratorStrategy() throws Exception {

        String template = "SELECT #result('id' 'int') FROM SUS1";
        SQLTemplate query = new SQLTemplate(Object.class, template);
        DataMap map = getDataMap();
        assertNotNull(map);
        DataNode dataNode = createDataNode(map);
        int sizeDB = getNameTablesInDB(dataNode).size();
        MockOperationObserver observer = new MockOperationObserver();
        try {
View Full Code Here

    public void testThrowOnPartialStrategyTableNoExist() throws Exception {

        String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID";
        SQLTemplate query = new SQLTemplate(Object.class, template);
        DataMap map = getDataMap();
        assertNotNull(map);
        MockOperationObserver observer = new MockOperationObserver();
        DataNode dataNode = createDataNode(map);

        setStrategy(ThrowOnPartialSchemaStrategy.class.getName(), dataNode);
View Full Code Here

    public void testMixedStrategyTableNoExist() throws Exception {

        String template = "SELECT #result('id' 'int') FROM SUS1";
        SQLTemplate query = new SQLTemplate(Object.class, template);
        DataMap map = getDataMap();
        assertNotNull(map);
        DataNode dataNode = createDataNode(map);
        int sizeDB = getNameTablesInDB(dataNode).size();
        MockOperationObserver observer = new MockOperationObserver();
View Full Code Here

    public void testNoStandartSchema() {
        String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID";
        SQLTemplate query = new SQLTemplate(Object.class, template);
        MockOperationObserver observer = new MockOperationObserver();
        DataMap map = getDataMap();
        assertNotNull(map);
        DataNode dataNode = createDataNode(map);

        setStrategy(TestSchemaUpdateStrategy.class.getName(), dataNode);
View Full Code Here

    private void withOneTableForThrowOnPartialAndMixStrategy(String strategy) {
        DbEntity entity = null;
        String template = "SELECT #result('ARTIST_ID' 'int') FROM ARTIST ORDER BY ARTIST_ID";
        SQLTemplate query = new SQLTemplate(Object.class, template);
        DataMap map = getDataMap();
        assertNotNull(map);
        MockOperationObserver observer = new MockOperationObserver();
        DataNode dataNode = createDataNode(map);

        DataNode dataNode2 = createDataNode(map);
View Full Code Here

TOP

Related Classes of org.apache.cayenne.map.DataMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.