Package org.datanucleus.metadata

Examples of org.datanucleus.metadata.FieldMetaData


    /* (non-Javadoc)
     * @see javax.jdo.metadata.EmbeddedMetadata#newFieldMetadata(java.lang.String)
     */
    public FieldMetadata newFieldMetadata(String name)
    {
        FieldMetaData internalFmd = getInternal().newFieldMetaData(name);
        FieldMetadataImpl fmd = new FieldMetadataImpl(internalFmd);
        fmd.parent = this;
        return fmd;
    }
View Full Code Here


            {
                mmd = new PropertyMetaData(acmd, getAttr(attrs,"name"));
            }
            else
            {
                mmd = new FieldMetaData(acmd, getAttr(attrs,"name"));
            }
            mmd.setPersistenceModifier(FieldPersistenceModifier.PERSISTENT.toString());
            mmd.setDefaultFetchGroup(dfg);
            mmd.setDependent(getAttr(attrs,"dependent"));
            mmd.setMappedBy(getAttr(attrs,"mapped-by"));
View Full Code Here

            {
                mmd = new PropertyMetaData(acmd, getAttr(attrs, "name"));
            }
            else
            {
                mmd = new FieldMetaData(acmd, getAttr(attrs, "name"));
            }
            mmd.setPersistenceModifier(FieldPersistenceModifier.PERSISTENT.toString());
            mmd.setPrimaryKey(true);
            if (defaultCascadePersist)
            {
View Full Code Here

        {
            mmd = new PropertyMetaData(md, name);
        }
        else
        {
            mmd = new FieldMetaData(md, name);
        }
        mmd.setNotPersistent();
        if (defaultCascadePersist)
        {
            // This file has <persistence-unit-defaults> set to cascade-persist all fields
View Full Code Here

        {
            mmd = new PropertyMetaData(md, "#UNKNOWN." + getAttr(attrs, "name"));
        }
        else
        {
            mmd = new FieldMetaData(md, "#UNKNOWN." + getAttr(attrs, "name"));
        }
        mmd.setPersistenceModifier(FieldPersistenceModifier.PERSISTENT.toString());
        if (defaultCascadePersist)
        {
            // This file has <persistence-unit-defaults> set to cascade-persist all fields
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jdo.metadata.ClassMetadata#newFieldMetadata(java.lang.String)
     */
    public FieldMetadata newFieldMetadata(String name)
    {
        FieldMetaData internalFmd = getInternal().newFieldMetadata(name);
        FieldMetadataImpl fmd = new FieldMetadataImpl(internalFmd);
        fmd.parent = this;
        return fmd;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jdo.metadata.ClassMetadata#newFieldMetadata(java.lang.reflect.Field)
     */
    public FieldMetadata newFieldMetadata(Field fld)
    {
        FieldMetaData internalFmd = getInternal().newFieldMetadata(fld.getName());
        FieldMetadataImpl fmd = new FieldMetadataImpl(internalFmd);
        fmd.parent = this;
        return fmd;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jdo.metadata.FetchGroupMetadata#newFieldMetadata(java.lang.String)
     */
    public FieldMetadata newFieldMetadata(String name)
    {
        FieldMetaData internalFmd = getInternal().newFieldMetaData(name);
        FieldMetadataImpl fmd = new FieldMetadataImpl(internalFmd);
        fmd.parent = this;
        return fmd;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jdo.metadata.UniqueMetadata#newFieldMetadata(java.lang.String)
     */
    public FieldMetadata newFieldMetadata(String name)
    {
        FieldMetaData internalFmd = getInternal().newFieldMetaData(name);
        FieldMetadataImpl fmd = new FieldMetadataImpl(internalFmd);
        fmd.parent = this;
        return fmd;
    }
View Full Code Here

                                    overriddenFields = new HashSet<AbstractMemberMetaData>();
                                }

                                for (int j=0;j<overrides.length;j++)
                                {
                                    AbstractMemberMetaData fmd = new FieldMetaData(cmd,
                                        "#UNKNOWN." + overrides[j].name());
                                    fmd.setPersistenceModifier(FieldPersistenceModifier.PERSISTENT.toString());
                                    Column col = overrides[j].column();
                                    // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                                    ColumnMetaData colmd = new ColumnMetaData();
                                    colmd.setName(col.name());
                                    colmd.setLength(col.length());
                                    colmd.setScale(col.scale());
                                    colmd.setAllowsNull(col.nullable());
                                    colmd.setInsertable(col.insertable());
                                    colmd.setUpdateable(col.updatable());
                                    colmd.setUnique(col.unique());
                                    fmd.addColumn(colmd);
                                    overriddenFields.add(fmd);
                                }
                            }
                        }
                        else if (annName.equals(JPAAnnotationUtils.ATTRIBUTE_OVERRIDE))
                        {
                            if (overriddenFields == null)
                            {
                                overriddenFields = new HashSet<AbstractMemberMetaData>();
                            }

                            AbstractMemberMetaData fmd = new FieldMetaData(cmd,
                                "#UNKNOWN." + (String)annotationValues.get("name"));
                            Column col = (Column)annotationValues.get("column");
                            // TODO Make inferrals about jdbctype, length etc if the field is 1 char etc
                            ColumnMetaData colmd = new ColumnMetaData();
                            colmd.setName(col.name());
                            colmd.setLength(col.length());
                            colmd.setScale(col.scale());
                            colmd.setAllowsNull(col.nullable());
                            colmd.setInsertable(col.insertable());
                            colmd.setUpdateable(col.updatable());
                            colmd.setUnique(col.unique());
                            fmd.addColumn(colmd);
                            overriddenFields.add(fmd);
                        }
                        else if (annName.equals(JPAAnnotationUtils.ASSOCIATION_OVERRIDES))
                        {
                            AssociationOverride[] overrides = (AssociationOverride[])annotationValues.get("value");
                            if (overrides != null)
                            {
                                if (overriddenFields == null)
                                {
                                    overriddenFields = new HashSet<AbstractMemberMetaData>();
                                }

                                for (int j=0;j<overrides.length;j++)
                                {
                                    AbstractMemberMetaData fmd = new FieldMetaData(cmd,
                                        "#UNKNOWN." + overrides[j].name());
                                    JoinColumn[] cols = overrides[j].joinColumns();
                                    for (int k=0;k<cols.length;k++)
                                    {
                                        ColumnMetaData colmd = new ColumnMetaData();
                                        colmd.setName(cols[k].name());
                                        colmd.setTarget(cols[k].referencedColumnName());
                                        colmd.setAllowsNull(cols[k].nullable());
                                        colmd.setInsertable(cols[k].insertable());
                                        colmd.setUpdateable(cols[k].updatable());
                                        colmd.setUnique(cols[k].unique());
                                        fmd.addColumn(colmd);
                                    }
                                    overriddenFields.add(fmd);
                                }
                            }
                        }
                        else if (annName.equals(JPAAnnotationUtils.ASSOCIATION_OVERRIDE))
                        {
                            if (overriddenFields == null)
                            {
                                overriddenFields = new HashSet<AbstractMemberMetaData>();
                            }

                            AbstractMemberMetaData fmd = new FieldMetaData(cmd,
                                "#UNKNOWN." + (String)annotationValues.get("name"));
                            JoinColumn[] cols = (JoinColumn[])annotationValues.get("joinColumns");
                            for (int k=0;k<cols.length;k++)
                            {
                                ColumnMetaData colmd = new ColumnMetaData();
                                colmd.setName(cols[k].name());
                                colmd.setTarget(cols[k].referencedColumnName());
                                colmd.setAllowsNull(cols[k].nullable());
                                colmd.setInsertable(cols[k].insertable());
                                colmd.setUpdateable(cols[k].updatable());
                                colmd.setUnique(cols[k].unique());
                                fmd.addColumn(colmd);
                            }
                            overriddenFields.add(fmd);
                        }
                        else if (annName.equals(JPAAnnotationUtils.NAMED_QUERIES))
                        {
View Full Code Here

TOP

Related Classes of org.datanucleus.metadata.FieldMetaData

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.