Examples of JpaTable


Examples of org.apache.cayenne.jpa.map.JpaTable

    class JpaTableVisitor extends NestedVisitor {

        @Override
        Object createObject(ProjectPath path) {

            JpaTable jpaTable = (JpaTable) path.getObject();
            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            DbEntity cayenneEntity = parentCayenneEntity.getDataMap().getDbEntity(
                    jpaTable.getName());
            if (cayenneEntity == null) {
                cayenneEntity = new DbEntity(jpaTable.getName());
                parentCayenneEntity.getDataMap().addDbEntity(cayenneEntity);
            }

            // override catalog and schema even if this is an existing entity. See for
            // instance JpaColumnVisitor for an example on how an entity without all
            // properties is created early.
            cayenneEntity.setCatalog(jpaTable.getCatalog());
            cayenneEntity.setSchema(jpaTable.getSchema());

            parentCayenneEntity.setDbEntity(cayenneEntity);
            return cayenneEntity;
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                        && entity.lookupInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
                    // no dedicated table for the single_table inheritance subclass
                }
                // default table (see @Table annotation defaults, JPA spec 9.1.1)
                else if (entity.getTable() == null) {
                    JpaTable table = new JpaTable(AnnotationPrototypes.getTable());

                    // unclear whether we need to apply any other name transformations
                    // ...
                    // or even if we need to uppercase the name. Per default examples
                    // looks
                    // like we need. table.setName(entity.getName().toUpperCase());
                    table.setName(entity.getName());
                    entity.setTable(table);
                }

                return true;
            }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

    class JpaTableVisitor extends NestedVisitor {

        @Override
        Object createObject(ProjectPath path) {

            JpaTable jpaTable = (JpaTable) path.getObject();
            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            DbEntity cayenneEntity = parentCayenneEntity.getDataMap().getDbEntity(
                    jpaTable.getName());
            if (cayenneEntity == null) {
                cayenneEntity = new DbEntity(jpaTable.getName());
                parentCayenneEntity.getDataMap().addDbEntity(cayenneEntity);
            }

            // override catalog and schema even if this is an existing entity. See for
            // instance JpaColumnVisitor for an example on how an entity without all
            // properties is created early.
            cayenneEntity.setCatalog(jpaTable.getCatalog());
            cayenneEntity.setSchema(jpaTable.getSchema());

            parentCayenneEntity.setDbEntity(cayenneEntity);
            return cayenneEntity;
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                        && entity.lookupInheritanceStrategy() == InheritanceType.SINGLE_TABLE) {
                    // no dedicated table for the single_table inheritance subclass
                }
                // default table (see @Table annotation defaults, JPA spec 9.1.1)
                else if (entity.getTable() == null) {
                    JpaTable table = new JpaTable(AnnotationPrototypes.getTable());

                    // unclear whether we need to apply any other name transformations
                    // ...
                    // or even if we need to uppercase the name. Per default examples
                    // looks
                    // like we need. table.setName(entity.getName().toUpperCase());
                    table.setName(entity.getName());
                    entity.setTable(table);
                }

                return true;
            }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

    class JpaTableVisitor extends NestedVisitor {

        @Override
        Object createObject(ProjectPath path) {

            JpaTable jpaTable = (JpaTable) path.getObject();
            ObjEntity parentCayenneEntity = (ObjEntity) targetPath.getObject();

            DbEntity cayenneEntity = parentCayenneEntity.getDataMap().getDbEntity(
                    jpaTable.getName());
            if (cayenneEntity == null) {
                cayenneEntity = new DbEntity(jpaTable.getName());
                parentCayenneEntity.getDataMap().addDbEntity(cayenneEntity);
            }

            // override catalog and schema even if this is an existing entity. See for
            // instance JpaColumnVisitor for an example on how an entity without all
            // properties is created early.
            cayenneEntity.setCatalog(jpaTable.getCatalog());
            cayenneEntity.setSchema(jpaTable.getSchema());

            parentCayenneEntity.setDbEntity(cayenneEntity);
            return cayenneEntity;
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                JpaEntity entity,
                AnnotatedElement element,
                AnnotationProcessorStack context) {

            Table annotation = element.getAnnotation(Table.class);
            entity.setTable(new JpaTable(annotation));
        }
View Full Code Here

Examples of org.apache.cayenne.jpa.map.JpaTable

                    entity.setName(split > 0 ? fqName.substring(split + 1) : fqName);
                }

                // * default table (see @Table annotation defaults, JPA spec 9.1.1)
                if (entity.getTable() == null) {
                    JpaTable table = new JpaTable(AnnotationPrototypes.getTable());

                    // unclear whether we need to apply any other name transformations ...
                    // or even if we need to uppercase the name. Per default examples
                    // looks
                    // like we need. table.setName(entity.getName().toUpperCase());
                    table.setName(entity.getName());
                    entity.setTable(table);
                }
            }

            if (abstractEntity.getAttributes() == null) {
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.