Package org.eclipse.persistence.mappings.converters

Examples of org.eclipse.persistence.mappings.converters.EnumTypeConverter


    protected XMLDirectMapping getJoinFetchMapping() {
        XMLDirectMapping joinFetchMapping = new XMLDirectMapping();
        joinFetchMapping.setAttributeName("m_joinFetch");
        joinFetchMapping.setGetMethodName("getJoinFetch");
        joinFetchMapping.setSetMethodName("setJoinFetch");
        joinFetchMapping.setConverter(new EnumTypeConverter(joinFetchMapping, JoinFetchType.class, false));
        joinFetchMapping.setXPath("orm:join-fetch/text()");
        return joinFetchMapping;
    }
View Full Code Here


    protected XMLDirectMapping getLockModeMapping() {
        XMLDirectMapping lockModeMapping = new XMLDirectMapping();
        lockModeMapping.setAttributeName("m_lockMode");
        lockModeMapping.setGetMethodName("getLockMode");
        lockModeMapping.setSetMethodName("setLockMode");
        lockModeMapping.setConverter(new EnumTypeConverter(lockModeMapping, LockModeType.class, false));
        lockModeMapping.setXPath("orm:lock-mode");
        return lockModeMapping;
    }
View Full Code Here

    protected XMLDirectMapping getTemporalMapping() {
        XMLDirectMapping temporalMapping = new XMLDirectMapping();
        temporalMapping.setAttributeName("m_temporal");
        temporalMapping.setGetMethodName("getTemporal");
        temporalMapping.setSetMethodName("setTemporal");
        temporalMapping.setConverter(new EnumTypeConverter(temporalMapping, TemporalType.class, false));
        temporalMapping.setXPath("orm:temporal/text()");   
        return temporalMapping;
    }
View Full Code Here

    }

    protected AbstractDirectMapping addDirectMappingForEnum(String fieldName, String className,
        String columnName) {
        DirectToFieldMapping dtfm = addDirectMapping(fieldName, null, columnName);
        dtfm.setConverter(new EnumTypeConverter(dtfm, className));
        addMapping(dtfm);
        return dtfm;
    }
View Full Code Here

        XMLDirectMapping keepAsElementMapping = new XMLDirectMapping();
        keepAsElementMapping.setAttributeName("keepAsElementPolicy");
        keepAsElementMapping.setGetMethodName("getKeepAsElementPolicy");
        keepAsElementMapping.setSetMethodName("setKeepAsElementPolicy");
        keepAsElementMapping.setXPath(getPrimaryNamespaceXPath() + "keep-as-element-policy");
        EnumTypeConverter converter = new EnumTypeConverter(keepAsElementMapping, UnmarshalKeepAsElementPolicy.class, false);
        keepAsElementMapping.setConverter(converter);
        descriptor.addMapping(keepAsElementMapping);

        return descriptor;
    }
View Full Code Here

         XMLDirectMapping nrfxMapping = new XMLDirectMapping();
         nrfxMapping.setAttributeName("marshalNullRepresentation");
         nrfxMapping.setXPath(getPrimaryNamespaceXPath() + "null-representation-for-xml/text()");
         // Restricted to XSI_NIL,ABSENT_NODE,EMPTY_NODE
         EnumTypeConverter aConverter = new EnumTypeConverter(nrfxMapping, XMLNullRepresentationType.class, false);
         nrfxMapping.setConverter(aConverter);
         aDescriptor.addMapping(nrfxMapping);

         // Subclasses
         aDescriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("@xsi:type"));
View Full Code Here

         descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);

         XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
         wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
         wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
         EnumTypeConverter oraclePLSQLTypesEnumTypeConverter = new EnumTypeConverter(
             wrappedDatabaseTypeMapping, OraclePLSQLTypes.class, false);
         wrappedDatabaseTypeMapping.setConverter(oraclePLSQLTypesEnumTypeConverter);
         descriptor.addMapping(wrappedDatabaseTypeMapping);

         return descriptor;
View Full Code Here

         descriptor.getInheritancePolicy().setParentClass(DatabaseTypeWrapper.class);

         XMLDirectMapping wrappedDatabaseTypeMapping = new XMLDirectMapping();
         wrappedDatabaseTypeMapping.setAttributeName("wrappedDatabaseType");
         wrappedDatabaseTypeMapping.setXPath("@" + TYPE_NAME);
         EnumTypeConverter jdbcTypesEnumTypeConverter = new EnumTypeConverter(
             wrappedDatabaseTypeMapping, JDBCTypes.class, false);
         wrappedDatabaseTypeMapping.setConverter(jdbcTypesEnumTypeConverter);
         descriptor.addMapping(wrappedDatabaseTypeMapping);

         return descriptor;
View Full Code Here

        MetadataClass dataType = getDataType(accessor, referenceClass);
        MetadataClass objectType = getObjectType(accessor, referenceClass);
       
        if (objectType.isEnum()) {
            // Create an EnumTypeConverter.
            converter = new EnumTypeConverter(mapping, objectType.getName());
           
            // The object values should be the names of the enum members so
            // force the objectType to String to ensure the initObject calls
            // below will work.
            objectType = getMetadataFactory().getMetadataClass(String.class.getName());
View Full Code Here

        }
        boolean isOrdinal = true;
        if (m_enumeratedType != null) {
            isOrdinal = m_enumeratedType.equals(JPA_ENUM_ORDINAL);
        }
        setConverter(mapping, new EnumTypeConverter(mapping, referenceClass.getName(), isOrdinal), isForMapKey);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.mappings.converters.EnumTypeConverter

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.