Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.DataMap.addDbEntity()


            if (content instanceof DbEntity) {
                DbEntity dbEntity = (DbEntity) content;
                dbEntity.setName(getFreeName(new DbEntityNameChecker(domain), dbEntity
                        .getName()));

                dataMap.addDbEntity(dbEntity);
                CreateDbEntityAction.fireDbEntityEvent(this, mediator, dbEntity);
            }
            else if (content instanceof ObjEntity) {
                // paste ObjEntity to DataMap
                ObjEntity objEntity = (ObjEntity) content;
View Full Code Here


                    dbEntityName = dbEntityBaseName + i++;
                }

                objEntity.setDbEntityName(dbEntityName);
                DbEntity de = new DbEntity(dbEntityName);
                dataMap.addDbEntity(de);
            }
        }

        // set various flags
        objEntity.setReadOnly("Y".equals(entityPlist.get("isReadOnly")));
View Full Code Here

        entity.setName(newName);
        DataMap map = entity.getDataMap();

        if (map != null) {
            map.removeDbEntity(oldName, false);
            map.addDbEntity(entity);

            // important - clear parent namespace:
            MappingNamespace ns = map.getNamespace();
            if (ns instanceof EntityResolver) {
                ((EntityResolver) ns).refreshMappingCache();
View Full Code Here

        // must have a dummy datamap for the dummy table for the downstream code
        // to work
        DataMap map = new DataMap("dummy");
        map.setQuotingSQLIdentifiers(map.isQuotingSQLIdentifiers());
        DbEntity entity = new DbEntity(tableName);
        map.addDbEntity(entity);

        AbstractToDbToken t = (AbstractToDbToken) mergerFactory()
                .createDropTableToDb(entity);

        for (String sql : t.createSql(node.getAdapter())) {
View Full Code Here

        entity.setName(newName);
        DataMap map = entity.getDataMap();

        if (map != null) {
            map.removeDbEntity(oldName, false);
            map.addDbEntity(entity);

            // important - clear parent namespace:
            MappingNamespace ns = map.getNamespace();
            if (ns instanceof EntityResolver) {
                ((EntityResolver) ns).clearCache();
View Full Code Here

            if (content instanceof DbEntity) {
                DbEntity dbEntity = (DbEntity) content;
                dbEntity.setName(getFreeName(new DbEntityNameChecker(domain), dbEntity
                        .getName()));

                dataMap.addDbEntity(dbEntity);
                CreateDbEntityAction.fireDbEntityEvent(this, mediator, dbEntity);
            }
            else if (content instanceof ObjEntity) {
                // paste ObjEntity to DataMap
                ObjEntity objEntity = (ObjEntity) content;
View Full Code Here

            if (content instanceof DbEntity) {
                DbEntity dbEntity = (DbEntity) content;
                dbEntity.setName(getFreeName(new DbEntityNameChecker(domain), dbEntity
                        .getName()));

                dataMap.addDbEntity(dbEntity);
                CreateDbEntityAction.fireDbEntityEvent(this, mediator, dbEntity);
            }
            else if (content instanceof ObjEntity) {
                // paste ObjEntity to DataMap
                ObjEntity objEntity = (ObjEntity) content;
View Full Code Here

        ObjEntity objEntity = new ObjEntity("456");
        entityContainer.addObjEntity(objEntity);

        DbEntity dbe = new DbEntity("123");
        objEntity.setDbEntityName("123");
        entityContainer.addDbEntity(dbe);

        DbAttribute at = new DbAttribute("xyz");
        at.setPrimaryKey(true);
        dbe.addAttribute(at);
View Full Code Here

    public void testCreateObjectIdNulls() throws Exception {
        // must provide a map container for the entities
        DataMap entityContainer = new DataMap();

        DbEntity dbe = new DbEntity("123");
        entityContainer.addDbEntity(dbe);

        DbAttribute at = new DbAttribute("xyz");
        at.setPrimaryKey(true);
        dbe.addAttribute(at);
View Full Code Here

        if (entity == null) {
            // table may be defined in a superclass that is not processed yet... so create
            // a barebone version, with all remaining properties to be set later
            entity = new DbEntity(tableName);
            dataMap.addDbEntity(entity);
        }

        entity.addAttribute(dbAttribute);
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.