Examples of addForeignKey()


Examples of org.apache.openjpa.jdbc.schema.Table.addForeignKey()

        assertTrue(table.removeColumn(c1));
        assertTrue(!table.isNameTaken("c1"));
        assertNull(table.getColumn("c1"));

        // foreign key testing
        ForeignKey fk = table.addForeignKey("fk");
        assertTrue(_schema.getSchemaGroup().isNameTaken("fk"));
        assertTrue(!table.isNameTaken("fk"));
        assertEquals(table, fk.getTable());
        ForeignKey[] fks = table.getForeignKeys();
        assertEquals(1, fks.length);
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.Table.addForeignKey()

            else
                tcols[i] = getEquivalentColumn(cols[i].getIdentifier(), target,
                    false);
        }

        ForeignKey newfk = table.addForeignKey();
        newfk.setJoins(cols, tcols);
        if (_fk != null) {
            cols = _fk.getConstantColumns();
            for (int i = 0; i < cols.length; i++)
                newfk.joinConstant(cols[i], _fk.getConstant(cols[i]));
View Full Code Here

Examples of org.apache.torque.map.TableMap.addForeignKey()

              tMap.addPrimaryKey("security_allow.ID", new Long(0));
                    tMap.addColumn("security_allow.ALLOW_TYPE", new String());
                    tMap.addColumn("security_allow.ALLOW_VALUE", new String());
                    tMap.addColumn("security_allow.ALLOW_GROUP", new String());
                    tMap.addForeignKey(
                "security_allow.ACCESS_ID", new Long(0) , "security_access" ,
                "ID");
          }
}
View Full Code Here

Examples of org.apache.torque.map.TableMap.addForeignKey()

                    tMap.addColumn("portlet_parameter.CACHED_ON_VALUE", new Integer(0));
                    tMap.addColumn("portlet_parameter.CACHED_ON_NAME", new Integer(0));
                    tMap.addColumn("portlet_parameter.TITLE", new String());
                    tMap.addColumn("portlet_parameter.DESCRIPTION", new String());
                    tMap.addColumn("portlet_parameter.IMAGE", new String());
                    tMap.addForeignKey(
                "portlet_parameter.PORTLET_ID", new Long(0) , "portlet" ,
                "ID");
                    tMap.addColumn("portlet_parameter.SECURITY", new String());
          }
}
View Full Code Here

Examples of org.apache.torque.map.TableMap.addForeignKey()

        tMap.setPrimaryKeyMethodInfo("security_access_SEQ");

              tMap.addPrimaryKey("security_access.ID", new Long(0));
                    tMap.addColumn("security_access.ACTION", new String());
                    tMap.addForeignKey(
                "security_access.ENTRY_ID", new Long(0) , "security_entry" ,
                "ID");
          }
}
View Full Code Here

Examples of org.apache.torque.map.TableMap.addForeignKey()

        tMap.setPrimaryKeyMethodInfo("portlet_mediatype_SEQ");

              tMap.addPrimaryKey("portlet_mediatype.ID", new Long(0));
                    tMap.addColumn("portlet_mediatype.NAME", new String());
                    tMap.addForeignKey(
                "portlet_mediatype.PORTLET_ID", new Long(0) , "portlet" ,
                "ID");
          }
}
View Full Code Here

Examples of org.apache.torque.map.TableMap.addForeignKey()

        tMap.setPrimaryKeyMethodInfo("portlet_category_SEQ");

              tMap.addPrimaryKey("portlet_category.ID", new Long(0));
                    tMap.addColumn("portlet_category.NAME", new String());
                    tMap.addColumn("portlet_category.GROUPE", new String());
                    tMap.addForeignKey(
                "portlet_category.PORTLET_ID", new Long(0) , "portlet" ,
                "ID");
          }
}
View Full Code Here

Examples of org.datanucleus.metadata.AbstractClassMetaData.addForeignKey()

                    Iterator iter = fks.iterator();
                    while (iter.hasNext())
                    {
                        ForeignKeyMetaData fkmd = (ForeignKeyMetaData)iter.next();
                        fkmd.setParent(cmd);
                        cmd.addForeignKey(fkmd);
                    }
                }
                if (unmappedColumns != null)
                {
                    for (int i=0;i<unmappedColumns.length;i++)
View Full Code Here

Examples of org.datanucleus.metadata.AbstractClassMetaData.addForeignKey()

                fkmd.setDeleteAction(ForeignKeyAction.getForeignKeyAction(getAttr(attrs,"delete-action")));
                fkmd.setUpdateAction(ForeignKeyAction.getForeignKeyAction(getAttr(attrs,"update-action")));
                if (md instanceof AbstractClassMetaData)
                {
                    AbstractClassMetaData cmd = (AbstractClassMetaData)md;
                    cmd.addForeignKey(fkmd);
                }
                else if (md instanceof AbstractMemberMetaData)
                {
                    AbstractMemberMetaData fmd = (AbstractMemberMetaData)md;
                    fmd.setForeignKeyMetaData(fkmd);
View Full Code Here

Examples of org.datanucleus.metadata.ClassMetaData.addForeignKey()

                fkmd.setDeleteAction(ForeignKeyAction.getForeignKeyAction(getAttr(attrs,"delete-action")));
                fkmd.setUpdateAction(ForeignKeyAction.getForeignKeyAction(getAttr(attrs,"update-action")));
                if (md instanceof AbstractClassMetaData)
                {
                    AbstractClassMetaData cmd = (AbstractClassMetaData)md;
                    cmd.addForeignKey(fkmd);
                }
                else if (md instanceof AbstractMemberMetaData)
                {
                    AbstractMemberMetaData fmd = (AbstractMemberMetaData)md;
                    fmd.setForeignKeyMetaData(fkmd);
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.