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

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


        FieldInfoFactory factory = new FieldInfoFactory();
        FieldInfo flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "flat");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.addForeignKey("fk_flat");
        assertEquals("fk_flat", (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 flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "token");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.addForeignKey("fk_1");
        relation.addForeignKey("fk_2");
       
        List keys = relation.getForeignKeys();
       
        if (keys.get(0).equals("fk_1")) {
View Full Code Here

        FieldInfo flat = factory.createFieldInfo(new XSClass(new JClass(
                "House")), "token");
        flat.addNature(JDOOneToManyNature.class.getName());
        JDOOneToManyNature relation = new JDOOneToManyNature(flat);
        relation.addForeignKey("fk_1");
        relation.addForeignKey("fk_2");
       
        List keys = relation.getForeignKeys();
       
        if (keys.get(0).equals("fk_1")) {
            // Check the second entry
View Full Code Here

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