private javax.persistence.EnumType getEnumType(ParameterType reader) { javax.persistence.EnumType enumType = null; if ( reader.isPrimaryKey() ) { MapKeyEnumerated enumAnn = getAnnotation( reader.getAnnotationsMethod(), MapKeyEnumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } else { Enumerated enumAnn = getAnnotation( reader.getAnnotationsMethod(), Enumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } return enumType; }
@Test public void testMapKeyEnumerated() throws Exception { reader = getReader( Entity3.class, "field1", "element-collection.orm9.xml" ); assertAnnotationPresent( ElementCollection.class ); assertAnnotationNotPresent( MapKey.class ); assertAnnotationNotPresent( MapKeyClass.class ); assertAnnotationNotPresent( MapKeyTemporal.class ); assertAnnotationPresent( MapKeyEnumerated.class ); assertAnnotationNotPresent( MapKeyColumn.class ); assertAnnotationNotPresent( MapKeyJoinColumns.class ); assertAnnotationNotPresent( MapKeyJoinColumn.class ); assertEquals( EnumType.STRING, reader.getAnnotation( MapKeyEnumerated.class ).value() ); }
@Test public void testMapKeyEnumerated() throws Exception { reader = getReader( Entity3.class, "field1", "many-to-many.orm9.xml" ); assertAnnotationPresent( ManyToMany.class ); assertAnnotationNotPresent( MapKey.class ); assertAnnotationNotPresent( MapKeyClass.class ); assertAnnotationNotPresent( MapKeyTemporal.class ); assertAnnotationPresent( MapKeyEnumerated.class ); assertAnnotationNotPresent( MapKeyColumn.class ); assertAnnotationNotPresent( MapKeyJoinColumns.class ); assertAnnotationNotPresent( MapKeyJoinColumn.class ); assertEquals( EnumType.STRING, reader.getAnnotation( MapKeyEnumerated.class ).value() ); }
private javax.persistence.EnumType getEnumType(XProperty property) { javax.persistence.EnumType enumType = null; if (key) { MapKeyEnumerated enumAnn = property.getAnnotation( MapKeyEnumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } else { Enumerated enumAnn = property.getAnnotation( Enumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } return enumType; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ private EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ private EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ private EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Handles the {@link MapKeyEnumerated} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected EnumType handleMapKeyEnumType(Member member, Set<Class<? extends Annotation>> parsed) { final MapKeyEnumerated annotation = ReflectHelper.getAnnotation(member, MapKeyEnumerated.class); if (annotation != null) { parsed.add(MapKeyEnumerated.class); return annotation.value(); } return null; }
/** * Parse @MapKeyEnumerated. */ private void parseMapKeyEnumerated(FieldMapping fm, MapKeyEnumerated anno) { String strat = EnumValueHandler.class.getName() + "(StoreOrdinal=" + String.valueOf(anno.value() == EnumType.ORDINAL) + ")"; fm.getKeyMapping().getValueInfo().setStrategy(strat); }
/** * Parse @MapKeyEnumerated. */ private void parseMapKeyEnumerated(FieldMapping fm, MapKeyEnumerated anno) { String strat = EnumValueHandler.class.getName() + "(StoreOrdinal=" + String.valueOf(anno.value() == EnumType.ORDINAL) + ")"; fm.getKeyMapping().getValueInfo().setStrategy(strat); }
/** * Parse @MapKeyEnumerated. */ private void parseMapKeyEnumerated(FieldMapping fm, MapKeyEnumerated anno) { String strat = EnumValueHandler.class.getName() + "(StoreOrdinal=" + String.valueOf(anno.value() == EnumType.ORDINAL) + ")"; fm.getKeyMapping().getValueInfo().setStrategy(strat); }
private void mapKeySupplementalDetails( XProperty navigableXProperty, MetadataBuildingContext buildingContext) { final MapKeyEnumerated mapKeyEnumeratedAnn = navigableXProperty.getAnnotation( MapKeyEnumerated.class ); if ( mapKeyEnumeratedAnn != null ) { enumType = mapKeyEnumeratedAnn.value(); } final MapKeyTemporal mapKeyTemporalAnn = navigableXProperty.getAnnotation( MapKeyTemporal.class ); if ( mapKeyTemporalAnn != null ) { temporalPrecision = mapKeyTemporalAnn.value(); } } private void normalSupplementalDetails(
private javax.persistence.EnumType getEnumType(XProperty property) { javax.persistence.EnumType enumType = null; if ( key ) { MapKeyEnumerated enumAnn = property.getAnnotation( MapKeyEnumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } else { Enumerated enumAnn = property.getAnnotation( Enumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } return enumType; }
private javax.persistence.EnumType getEnumType(XProperty property) { javax.persistence.EnumType enumType = null; if ( key ) { MapKeyEnumerated enumAnn = property.getAnnotation( MapKeyEnumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } else { Enumerated enumAnn = property.getAnnotation( Enumerated.class ); if ( enumAnn != null ) { enumType = enumAnn.value(); } } return enumType; }
enumType = enumeratedAnn.value(); if ( enumType == null ) { throw new IllegalStateException(