Search in sources :

Example 1 with EntityTreeFilter

use of org.apache.cayenne.modeler.util.EntityTreeFilter in project cayenne by apache.

the class SQLTemplatePrefetchTab method createBrowserModel.

protected TreeModel createBrowserModel(Entity entity) {
    EntityTreeModel treeModel = new EntityTreeModel(entity);
    treeModel.setFilter(new EntityTreeFilter() {

        public boolean attributeMatch(Object node, Attribute attr) {
            return false;
        }

        public boolean relationshipMatch(Object node, Relationship rel) {
            return true;
        }
    });
    return treeModel;
}
Also used : EntityTreeFilter(org.apache.cayenne.modeler.util.EntityTreeFilter) EntityTreeModel(org.apache.cayenne.modeler.util.EntityTreeModel) Attribute(org.apache.cayenne.map.Attribute) Relationship(org.apache.cayenne.map.Relationship)

Example 2 with EntityTreeFilter

use of org.apache.cayenne.modeler.util.EntityTreeFilter in project cayenne by apache.

the class SelectQueryPrefetchTab method createBrowserModel.

protected TreeModel createBrowserModel(Entity entity) {
    EntityTreeModel treeModel = new EntityTreeModel(entity);
    treeModel.setFilter(new EntityTreeFilter() {

        public boolean attributeMatch(Object node, Attribute attr) {
            return false;
        }

        public boolean relationshipMatch(Object node, Relationship rel) {
            return true;
        }
    });
    return treeModel;
}
Also used : EntityTreeFilter(org.apache.cayenne.modeler.util.EntityTreeFilter) EntityTreeModel(org.apache.cayenne.modeler.util.EntityTreeModel) Attribute(org.apache.cayenne.map.Attribute) Relationship(org.apache.cayenne.map.Relationship)

Aggregations

Attribute (org.apache.cayenne.map.Attribute)2 Relationship (org.apache.cayenne.map.Relationship)2 EntityTreeFilter (org.apache.cayenne.modeler.util.EntityTreeFilter)2 EntityTreeModel (org.apache.cayenne.modeler.util.EntityTreeModel)2