Package org.apache.empire.db

Examples of org.apache.empire.db.DBRelation


        }
       
        // add the relation
        DBRelation.DBReference reference = fkCol.referenceOn(pkCol);
        DBRelation.DBReference[] refs = null;
          DBRelation r = db.getRelation(relName);
            if (r!=null) {
              DBRelation.DBReference[] refsOld = r.getReferences();
              refs = new DBRelation.DBReference[refsOld.length+1];
              int i=0;
              for (; i<refsOld.length; i++)
                refs[i]=refsOld[i];
              refs[i]=reference;
View Full Code Here


    assertNotNull("Expected EMPLOYEES table.", employees);

        final List<DBRelation> relations = db.getRelations();
        assertEquals("Should have two relations.", 2, relations.size());

        final DBRelation dbRelation = relations.get(1);
        assertEquals("EMPLOYEES_DEPARTMENT_I_FK", dbRelation.getName());

        final DBReference[] references = dbRelation.getReferences();
        assertEquals("Should reference one column.", 1, references.length);

        final DBReference dbReference = references[0];
    assertEquals(dbReference.getSourceColumn(), employees.getColumn("DEPARTMENT_ID"));
        assertEquals(dbReference.getTargetColumn(), departments.getColumn("DEPARTMENT_ID"));
View Full Code Here

        }
       
        // add the relation
        DBRelation.DBReference reference = fkCol.referenceOn(pkCol);
        DBRelation.DBReference[] refs = null;
          DBRelation r = db.getRelation(relName);
            if (r!=null) {
              DBRelation.DBReference[] refsOld = r.getReferences();
              refs = new DBRelation.DBReference[refsOld.length+1];
              int i=0;
              for (; i<refsOld.length; i++)
                refs[i]=refsOld[i];
              refs[i]=reference;
View Full Code Here

TOP

Related Classes of org.apache.empire.db.DBRelation

Copyright © 2018 www.massapicom. 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.