Package org.datanucleus.metadata

Examples of org.datanucleus.metadata.ForeignKeyMetaData


     * @return The ForeignKeyMetaData
     */
    public static ForeignKeyMetaData getFKMetaData(String name, String table, String unique, String deferred,
            String deleteAction, String updateAction, String[] fields, Column[] columns)
    {
        ForeignKeyMetaData fkmd = new ForeignKeyMetaData();
        fkmd.setName(name);
        fkmd.setTable(table);
        fkmd.setUnique(unique);
        fkmd.setDeferred(deferred);
        fkmd.setDeleteAction(org.datanucleus.metadata.ForeignKeyAction.getForeignKeyAction(deleteAction));
        fkmd.setUpdateAction(org.datanucleus.metadata.ForeignKeyAction.getForeignKeyAction(updateAction));
        if (fields != null && fields.length > 0)
        {
            for (int j=0;j<fields.length;j++)
            {
                FieldMetaData fmd = new FieldMetaData(fkmd, fields[j]);
                fkmd.addMember(fmd);
            }
        }
        if (fkmd.getNumberOfMembers() == 0 && columns != null && columns.length > 0)
        {
            for (int j=0;j<columns.length;j++)
            {
                ColumnMetaData colmd = JDOAnnotationUtils.getColumnMetaDataForColumnAnnotation(columns[j]);
                fkmd.addColumn(colmd);
            }
        }

        return fkmd;
    }
View Full Code Here

TOP

Related Classes of org.datanucleus.metadata.ForeignKeyMetaData

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.