Package org.eclipse.persistence.mappings.converters

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


            throw ValidationException.invalidTypeForEnumeratedAttribute(mapping.getAttributeName(), getReferenceClass(), getJavaClass());
        } else {
            // Create an EnumTypeConverter and set it on the mapping.
            if (m_enumerated == null) {
                // TODO: Log a defaulting message
                setConverter(mapping, new EnumTypeConverter(mapping, getReferenceClass(), true));
            } else {
                setConverter(mapping, new EnumTypeConverter(mapping, getReferenceClass(), m_enumerated.name().equals(EnumType.ORDINAL.name())));
            }
        }
    }
View Full Code Here


       
        XMLDirectMapping cacheTypeMapping = new XMLDirectMapping();
        cacheTypeMapping.setAttributeName("m_type");
        cacheTypeMapping.setGetMethodName("getType");
        cacheTypeMapping.setSetMethodName("setType");
        cacheTypeMapping.setConverter(new EnumTypeConverter(cacheTypeMapping, CacheType.class, false));
        cacheTypeMapping.setXPath("@type");
        descriptor.addMapping(cacheTypeMapping);
       
        XMLDirectMapping alwaysRefreshMapping = new XMLDirectMapping();
        alwaysRefreshMapping.setAttributeName("m_alwaysRefresh");
        alwaysRefreshMapping.setGetMethodName("getAlwaysRefresh");
        alwaysRefreshMapping.setSetMethodName("setAlwaysRefresh");
        alwaysRefreshMapping.setXPath("@always-refresh");
        descriptor.addMapping(alwaysRefreshMapping);
       
        XMLDirectMapping refreshOnlyIfNewerMapping = new XMLDirectMapping();
        refreshOnlyIfNewerMapping.setAttributeName("m_refreshOnlyIfNewer");
        refreshOnlyIfNewerMapping.setGetMethodName("getRefreshOnlyIfNewer");
        refreshOnlyIfNewerMapping.setSetMethodName("setRefreshOnlyIfNewer");
        refreshOnlyIfNewerMapping.setXPath("@refresh-only-if-newer");
        descriptor.addMapping(refreshOnlyIfNewerMapping);
       
        XMLDirectMapping disableHitsMapping = new XMLDirectMapping();
        disableHitsMapping.setAttributeName("m_disableHits");
        disableHitsMapping.setGetMethodName("getDisableHits");
        disableHitsMapping.setSetMethodName("setDisableHits");
        disableHitsMapping.setXPath("@disable-hits");
        descriptor.addMapping(disableHitsMapping);
       
        XMLDirectMapping coordinationTypeMapping = new XMLDirectMapping();
        coordinationTypeMapping.setAttributeName("m_coordinationType");
        coordinationTypeMapping.setGetMethodName("getCoordinationType");
        coordinationTypeMapping.setSetMethodName("setCoordinationType");
        coordinationTypeMapping.setConverter(new EnumTypeConverter(coordinationTypeMapping, CacheCoordinationType.class, false));
        coordinationTypeMapping.setXPath("@coordination-type");
        descriptor.addMapping(coordinationTypeMapping);
     
        return descriptor;
    }
View Full Code Here

   
        XMLDirectMapping typeMapping = new XMLDirectMapping();
        typeMapping.setAttributeName("m_type");
        typeMapping.setGetMethodName("getType");
        typeMapping.setSetMethodName("setType");
        typeMapping.setConverter(new EnumTypeConverter(typeMapping, ChangeTrackingType.class, false));
        typeMapping.setXPath("@type");
        descriptor.addMapping(typeMapping);
       
        return descriptor;       
    }
View Full Code Here

       
        XMLDirectMapping discriminatorTypeMapping = new XMLDirectMapping();
        discriminatorTypeMapping.setAttributeName("m_discriminatorType");
        discriminatorTypeMapping.setGetMethodName("getDiscriminatorType");
        discriminatorTypeMapping.setSetMethodName("setDiscriminatorType");
        discriminatorTypeMapping.setConverter(new EnumTypeConverter(discriminatorTypeMapping, DiscriminatorType.class, false));
        discriminatorTypeMapping.setXPath("@discriminator-type");
        descriptor.addMapping(discriminatorTypeMapping);
       
        descriptor.addMapping(getColumnDefinitionAttributeMapping());
        descriptor.addMapping(getLengthAttributeMapping());
View Full Code Here

       
        XMLDirectMapping strategyMapping = new XMLDirectMapping();
        strategyMapping.setAttributeName("m_strategy");
        strategyMapping.setGetMethodName("getStrategy");
        strategyMapping.setSetMethodName("setStrategy");
        strategyMapping.setConverter(new EnumTypeConverter(strategyMapping, GenerationType.class, false));
        strategyMapping.setXPath("@strategy");
        descriptor.addMapping(strategyMapping);
       
        XMLDirectMapping generatorMapping = new XMLDirectMapping();
        generatorMapping.setAttributeName("m_generator");
View Full Code Here

       
        XMLDirectMapping strategyMapping = new XMLDirectMapping();
        strategyMapping.setAttributeName("m_strategy");
        strategyMapping.setGetMethodName("getStrategy");
        strategyMapping.setSetMethodName("setStrategy");
        strategyMapping.setConverter(new EnumTypeConverter(strategyMapping, InheritanceType.class, false));
        strategyMapping.setXPath("@strategy");
        descriptor.addMapping(strategyMapping);
       
        return descriptor;
    }
View Full Code Here

       
        XMLDirectMapping typeMapping = new XMLDirectMapping();
        typeMapping.setAttributeName("m_type");
        typeMapping.setGetMethodName("getType");
        typeMapping.setSetMethodName("setType");
        typeMapping.setConverter(new EnumTypeConverter(typeMapping, OptimisticLockingType.class, false));
        typeMapping.setXPath("@type");
        descriptor.addMapping(typeMapping);
       
        XMLDirectMapping cascadeMapping = new XMLDirectMapping();
        cascadeMapping.setAttributeName("m_cascade");
View Full Code Here

        XMLDescriptor descriptor = new XMLDescriptor();
        descriptor.setJavaClass(PrimaryKeyMetadata.class);
       
        XMLDirectMapping validationMapping = new XMLDirectMapping();
        validationMapping.setAttributeName("m_validation");
        validationMapping.setConverter(new EnumTypeConverter(validationMapping, IdValidation.class, false));
        validationMapping.setXPath("@validation");
        descriptor.addMapping(validationMapping);
       
        XMLCompositeCollectionMapping columnsMapping = new XMLCompositeCollectionMapping();
        columnsMapping.setAttributeName("m_columns");
View Full Code Here

   
        XMLDirectMapping directionMapping = new XMLDirectMapping();
        directionMapping.setAttributeName("m_direction");
        directionMapping.setGetMethodName("getDirection");
        directionMapping.setSetMethodName("setDirection");
        directionMapping.setConverter(new EnumTypeConverter(directionMapping, Direction.class, false));
        directionMapping.setXPath("@direction");
        descriptor.addMapping(directionMapping);
       
        descriptor.addMapping(getNameAttributeMapping());
       
View Full Code Here

    protected XMLDirectMapping getEnumeratedMapping() {
        XMLDirectMapping enumeratedMapping = new XMLDirectMapping();
        enumeratedMapping.setAttributeName("m_enumerated");
        enumeratedMapping.setGetMethodName("getEnumerated");
        enumeratedMapping.setSetMethodName("setEnumerated");
        enumeratedMapping.setConverter(new EnumTypeConverter(enumeratedMapping, EnumType.class, false));
        enumeratedMapping.setXPath("orm:enumerated/text()");
        return enumeratedMapping;
    }
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.