Package org.exolab.castor.builder.info.nature.relation

Examples of org.exolab.castor.builder.info.nature.relation.JDOOneToOneNature.addForeignKey()


        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo address = factory.createFieldInfo(new XSClass(new JClass(
                "Employee")), "address");
        address.addNature(JDOOneToOneNature.class.getName());
        JDOOneToOneNature relation = new JDOOneToOneNature(address);
        relation.addForeignKey("fk_address");
        assertEquals("fk_address", (String) relation.getForeignKeys().get(0));
    }

    /**
     * Test add and get foreign key methods with multiple foreign keys.
View Full Code Here


        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo address = factory.createFieldInfo(new XSClass(new JClass(
                "Employee")), "token");
        address.addNature(JDOOneToOneNature.class.getName());
        JDOOneToOneNature relation = new JDOOneToOneNature(address);
        relation.addForeignKey("fk_sin");
        relation.addForeignKey("fk_dateofbirth");
       
        List keys = relation.getForeignKeys();
       
        if (keys.get(0).equals("fk_sin")) {
View Full Code Here

        FieldInfo address = factory.createFieldInfo(new XSClass(new JClass(
                "Employee")), "token");
        address.addNature(JDOOneToOneNature.class.getName());
        JDOOneToOneNature relation = new JDOOneToOneNature(address);
        relation.addForeignKey("fk_sin");
        relation.addForeignKey("fk_dateofbirth");
       
        List keys = relation.getForeignKeys();
       
        if (keys.get(0).equals("fk_sin")) {
            // Check the second entry
View Full Code Here

                            fNature.setDirty(column.getDirty());
                        } else if (tmpObject instanceof OneToOne) {
                            OneToOne relation = (OneToOne) tmpObject;
                            fInfo.addNature(JDOOneToOneNature.class.getName());
                            JDOOneToOneNature oneNature = new JDOOneToOneNature(fInfo);
                            oneNature.addForeignKey(relation.getName());
                            oneNature.setDirty(relation.isDirty());
                            oneNature.setReadOnly(relation.isReadOnly());
                        } else if (tmpObject instanceof OneToMany) {
                            OneToMany relation = (OneToMany) tmpObject;
                            fInfo.addNature(JDOOneToManyNature.class.getName());
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.