Examples of JpaOneToOne


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

        JpaVersion a1 = attributes.getVersionAttributes().iterator().next();
        assertEquals("attribute2", a1.getName());

        // ONE-TO_ONE
        assertEquals(1, attributes.getOneToOneRelationships().size());
        JpaOneToOne a2 = attributes.getOneToOneRelationship("attribute3");
        assertEquals("attribute3", a2.getName());
        assertEquals("org.apache.cayenne.jpa.entity.MockTargetEntity1", a2
                .getTargetEntityName());
        assertTrue(a2.isOptional());
        assertSame(FetchType.LAZY, a2.getFetch());
        assertEquals("mb1", a2.getMappedBy());

        assertNotNull(a2.getCascade());
        Collection<CascadeType> cascades = a2.getCascade().getCascades();
        assertEquals(2, cascades.size());
        Iterator<CascadeType> cascades1It = cascades.iterator();
        assertSame(CascadeType.REMOVE, cascades1It.next());
        assertSame(CascadeType.REFRESH, cascades1It.next());
View Full Code Here

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

            JpaDbRelationship relationship = (JpaDbRelationship) objRelationship
                    .getDbRelationships()
                    .get(0);

            if (relationship != null) {
                JpaOneToOne jpaRelationship = (JpaOneToOne) path.getObject();
                relationship.setMappedBy(jpaRelationship.getMappedBy());
            }
            return relationship;
        }
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.