@Override public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { if ( propertiesAnnotatedWithMapsId == null ) { propertiesAnnotatedWithMapsId = new HashMap<>(); } Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<String, PropertyData>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
@Test public void testAllAttributes() throws Exception { reader = getReader( Entity1.class, "field1", "many-to-one.orm6.xml" ); assertAnnotationPresent( ManyToOne.class ); assertAnnotationNotPresent( JoinColumn.class ); assertAnnotationNotPresent( JoinColumns.class ); assertAnnotationNotPresent( JoinTable.class ); assertAnnotationPresent( Id.class ); assertAnnotationPresent( MapsId.class ); assertAnnotationPresent( Access.class ); ManyToOne relAnno = reader.getAnnotation( ManyToOne.class ); assertEquals( 0, relAnno.cascade().length ); assertEquals( FetchType.LAZY, relAnno.fetch() ); assertFalse( relAnno.optional() ); assertEquals( Entity3.class, relAnno.targetEntity() ); assertEquals( "col1", reader.getAnnotation( MapsId.class ).value() ); assertEquals( AccessType.PROPERTY, reader.getAnnotation( Access.class ) .value() ); }
@Override public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { if ( propertiesAnnotatedWithMapsId == null ) { propertiesAnnotatedWithMapsId = new HashMap<>(); } Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<String, PropertyData>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
public void addPropertyAnnotatedWithMapsId(XClass entityType, PropertyData property) { Map<String, PropertyData> map = propertiesAnnotatedWithMapsId.get( entityType ); if ( map == null ) { map = new HashMap<String, PropertyData>(); propertiesAnnotatedWithMapsId.put( entityType, map ); } map.put( property.getProperty().getAnnotation( MapsId.class ).value(), property ); }
/** * Handles the {@link MapsId} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected String handleMapsId(Member member, Set<Class<? extends Annotation>> parsed) { final MapsId annotation = ReflectHelper.getAnnotation(member, MapsId.class); if (annotation != null) { parsed.add(MapsId.class); return annotation.value(); } return null; }
/** * Handles the {@link MapsId} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected String handleMapsId(Member member, Set<Class<? extends Annotation>> parsed) { final MapsId annotation = ReflectHelper.getAnnotation(member, MapsId.class); if (annotation != null) { parsed.add(MapsId.class); return annotation.value(); } return null; }
/** * Handles the {@link MapsId} annotation. * * @param member * the member * @param parsed * the list of annotations parsed * @return the map key value * * @since 2.0.0 */ protected String handleMapsId(Member member, Set<Class<? extends Annotation>> parsed) { final MapsId annotation = ReflectHelper.getAnnotation(member, MapsId.class); if (annotation != null) { parsed.add(MapsId.class); return annotation.value(); } return null; }
/** * Parse @MapsId. */ private void parseMapsId(FieldMetaData fmd, MapsId anno) { String value = anno.value(); if (value != null) fmd.setMappedByIdValue(value); else fmd.setMappedByIdValue(""); }
/** * Parse @MapsId. */ private void parseMapsId(FieldMetaData fmd, MapsId anno) { String value = anno.value(); if (value != null) fmd.setMappedByIdValue(value); else fmd.setMappedByIdValue(""); }
/** * Parse @MapsId. */ private void parseMapsId(FieldMetaData fmd, MapsId anno) { String value = anno.value(); if (value != null) fmd.setMappedByIdValue(value); else fmd.setMappedByIdValue(""); }
/** * Parse @MapsId. */ private void parseMapsId(FieldMetaData fmd, MapsId anno) { String value = anno.value(); if (value != null) fmd.setMappedByIdValue(value); else fmd.setMappedByIdValue(""); }