Package org.apache.cayenne.map

Examples of org.apache.cayenne.map.ObjEntity.removeRelationship()


        ObjEntity paintingEntity = context.getEntityResolver().lookupObjEntity(
                Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity
                .getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        try {
            SelectQuery q = new SelectQuery(Artist.class);
            q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);
            final List<Artist> result = context.performQuery(q);
View Full Code Here


        ObjEntity paintingEntity = context.getEntityResolver().lookupObjEntity(
                Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity
                .getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        try {

            SelectQuery q = new SelectQuery(Artist.class);
            q.setQualifier(ExpressionFactory.matchExp("artistName", "artist2"));
View Full Code Here

                .getRelationship("toArtist");
        artistExhibitEntity.removeRelationship("toArtist");

        ObjRelationship exhibitToArtistExhibitRel = (ObjRelationship) exhibitEntity
                .getRelationship("artistExhibitArray");
        exhibitEntity.removeRelationship("artistExhibitArray");

        Expression e = ExpressionFactory.matchExp("artistName", "artist1");
        SelectQuery q = new SelectQuery("Artist", e);
        q.addPrefetch("paintingArray");
        q.addPrefetch("paintingArray.toGallery");
View Full Code Here

                .getRelationship("toArtist");
        artistExhibitEntity.removeRelationship("toArtist");

        ObjRelationship exhibitToArtistExhibitRel = (ObjRelationship) exhibitEntity
                .getRelationship("artistExhibitArray");
        exhibitEntity.removeRelationship("artistExhibitArray");

        Expression e = ExpressionFactory.matchExp("artistName", "artist1");
        SelectQuery q = new SelectQuery("Artist", e);
        q.addPrefetch("paintingArray");
        q.addPrefetch("paintingArray.toGallery");
View Full Code Here

        ObjEntity paintingEntity = context.getEntityResolver().lookupObjEntity(
                Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity
                .getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        SelectQuery q = new SelectQuery("Artist");
        q.addPrefetch("paintingArray");

        try {
View Full Code Here

        ObjEntity paintingEntity = context.getEntityResolver().lookupObjEntity(
                Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity
                .getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        SelectQuery q = new SelectQuery("Artist");
        q.setQualifier(ExpressionFactory.matchExp("artistName", "artist1"));
        q.addPrefetch("paintingArray");
View Full Code Here

        ObjRelationship artistExhibitToArtistRel = (ObjRelationship) artistExhibitEntity.getRelationship("toArtist");
        artistExhibitEntity.removeRelationship("toArtist");

        ObjRelationship exhibitToArtistExhibitRel = (ObjRelationship) exhibitEntity
                .getRelationship("artistExhibitArray");
        exhibitEntity.removeRelationship("artistExhibitArray");

        Expression e = ExpressionFactory.matchExp("artistName", "artist1");
        SelectQuery q = new SelectQuery("Artist", e);
        q.addPrefetch("paintingArray");
        q.addPrefetch("paintingArray.toGallery");
View Full Code Here

    public void testPrefetch_ToManyNoReverse() throws Exception {
        createTwoArtistsAndTwoPaintingsDataSet();

        ObjEntity paintingEntity = context.getEntityResolver().getObjEntity(Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity.getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        try {
            SelectQuery q = new SelectQuery(Artist.class);
            q.addPrefetch(Artist.PAINTING_ARRAY_PROPERTY);
            final List<Artist> result = context.performQuery(q);
View Full Code Here

    public void testPrefetch_ToManyNoReverseWithQualifier() throws Exception {
        createTwoArtistsAndTwoPaintingsDataSet();

        ObjEntity paintingEntity = context.getEntityResolver().getObjEntity(Painting.class);
        ObjRelationship relationship = (ObjRelationship) paintingEntity.getRelationship("toArtist");
        paintingEntity.removeRelationship("toArtist");

        try {

            SelectQuery q = new SelectQuery(Artist.class);
            q.setQualifier(ExpressionFactory.matchExp("artistName", "artist2"));
View Full Code Here

    protected void removeObjRelationship() {
        ProjectController mediator = getProjectController();
        ObjEntity entity = mediator.getCurrentObjEntity();
        ObjRelationship rel = mediator.getCurrentObjRelationship();
        entity.removeRelationship(rel.getName());
        RelationshipEvent e = new RelationshipEvent(
                Application.getFrame(),
                rel,
                entity,
                MapEvent.REMOVE);
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.