Examples of JDOField


Examples of org.apache.jdo.model.jdo.JDOField

     * Default Fetch Group.
     */
    public boolean isDefaultFetchGroupField(String classPath, String fieldName)
        throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError
    {
        final JDOField field = getJDOField(classPath, fieldName);
        if (field == null) {
            return false;
        }
        return field.isDefaultFetchGroup();
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * class.
     */
    public int getFieldNumber(String classPath, String fieldName)
        throws EnhancerMetaDataUserException, EnhancerMetaDataFatalError
    {
        final JDOField field = getJDOField(classPath, fieldName);
        if (field == null) {
            return -1;
        }
        return field.getRelativeFieldNumber();
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        if (skipXMLElements)
            return;
        boolean trace = logger.isTraceEnabled();
        if (trace)
            logger.trace("  <field>"); //NOI18N
        JDOField jdoField = null;
        try {
            // get the current JDOClass from context stack
            JDOClass jdoClass = (JDOClass)context.peek();
            String fieldName = meta.getValue("", "name"); //NOI18N
            jdoField =  jdoClass.createJDOField(fieldName);
            for (int i = 0; i < meta.getLength(); i++ ) {
                String name = meta.getLocalName(i);
                String value = meta.getValue(i);
                if (trace)
                    logger.trace("    " + name + " = " + value); //NOI18N
                if ("name".equals(name)) { //NOI18N
                    // name is already set during create => do nothing
                }
                else if ("persistence-modifier".equals(name)) { //NOI18N
                    int modifier =
                        PersistenceModifier.toPersistenceModifier(value);
                    jdoField.setPersistenceModifier(modifier);
                }
                else if ("primary-key".equals(name)) { //NOI18N
                    jdoField.setPrimaryKey(
                        Boolean.valueOf(value).booleanValue());
                }
                else if ("null-value".equals(name)) { //NOI18N
                    jdoField.setNullValueTreatment(
                        NullValueTreatment.toNullValueTreatment(value));
                }
                else if ("default-fetch-group".equals(name)) { //NOI18N
                    jdoField.setDefaultFetchGroup(
                        Boolean.valueOf(value).booleanValue());
                }
                else if ("embedded".equals(name)) { //NOI18N
                    jdoField.setEmbedded(
                        Boolean.valueOf(value).booleanValue());
                }
                else {
                    /* JDO2 metadata not yet fully supported =>
                       do not throw exception now
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        if (trace)
            logger.trace("  <collection>"); //NOI18N
        JDOCollection jdoCollection = null;
        try {
            // get the current JDOField from context stack
            JDOField jdoField = (JDOField)context.peek();
            jdoCollection = jdoField.createJDOCollection();
            for (int i = 0; i < meta.getLength(); i++ ) {
                String name = meta.getLocalName(i);
                String value = meta.getValue(i);
                if (trace)
                    logger.trace("    " + name + " = " + value); //NOI18N
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        if (trace)
            logger.trace("  <array>"); //NOI18N
        JDOArray jdoArray = null;
        try {
            // get the current JDOField from context stack
            JDOField jdoField = (JDOField)context.peek();
            jdoArray = jdoField.createJDOArray();
            for (int i = 0; i < meta.getLength(); i++ ) {
                String name = meta.getLocalName(i);
                String value = meta.getValue(i);
                if (trace)
                    logger.trace("    " + name + " = " + value); //NOI18N
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

        if (trace)
            logger.trace("  <map>"); //NOI18N
        JDOMap jdoMap = null;
        try {
            // get the current JDOField from context stack
            JDOField jdoField = (JDOField)context.peek();
            jdoMap = jdoField.createJDOMap();
            for (int i = 0; i < meta.getLength(); i++ ) {
                String name = meta.getLocalName(i);
                String value = meta.getValue(i);
                if (trace)
                    logger.trace("    " + name + " = " + value); //NOI18N
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

    /**
     * Get the type representation of the array component type.
     * @return the array component type
     */
    public JavaType getElementType() {
        JDOField jdoField = getDeclaringField();
        JavaType fieldType = jdoField.getType();
        return (fieldType != null) ? fieldType.getArrayComponentType() : null;
    }
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

            throw new ModelException(
                msg.msg("EXC_InvalidMember", "null")); //NOI18N
        }
        String name = member.getName();
        if (member instanceof JDOField) {
            JDOField field = (JDOField) member;
            // nullify mappedByName which removes mappedBy info
            field.setMappedByName(null);
            // nullify relationship which updates its inverse
            field.setRelationship(null);
            if (associatedProperties.containsValue(member)) {
                associatedProperties.remove(name);
            }
            else {
                declaredFields.remove(name);
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * @param name the name of the field
     * @exception ModelException if impossible
     */
    public JDOField createJDOField(String name) throws ModelException {
        // check whether there is a field with the specified name
        JDOField field = getDeclaredField(name);
        if (field == null) {
            field = newJDOFieldInstance(name);
            declaredFields.put(name, field);
        }
        else if (field instanceof JDOProperty) {
View Full Code Here

Examples of org.apache.jdo.model.jdo.JDOField

     * @exception ModelException if impossible
     */
    public JDOProperty createJDOProperty(String name) throws ModelException {
        // check whether there is a field or property with the specified name
        JDOProperty property = null;
        JDOField field = getDeclaredField(name);
        if (field == null) {
            property = newJDOPropertyInstance(name);
            declaredFields.put(name, property);
        }
        else if (field instanceof JDOProperty) {
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.