private boolean isProcessingId(XMLContext.Default defaults) { boolean isExplicit = defaults.getAccess() != null; boolean correctAccess = ( PropertyType.PROPERTY.equals( propertyType ) && AccessType.PROPERTY.equals( defaults.getAccess() ) ) || ( PropertyType.FIELD.equals( propertyType ) && AccessType.FIELD .equals( defaults.getAccess() ) ); boolean hasId = defaults.canUseJavaAnnotations() && ( isPhysicalAnnotationPresent( Id.class ) || isPhysicalAnnotationPresent( EmbeddedId.class ) ); //if ( properAccessOnMetadataComplete || properOverridingOnMetadataNonComplete ) { boolean mirrorAttributeIsId = defaults.canUseJavaAnnotations() && ( mirroredAttribute != null && ( mirroredAttribute.isAnnotationPresent( Id.class ) || mirroredAttribute.isAnnotationPresent( EmbeddedId.class ) ) ); boolean propertyIsDefault = PropertyType.PROPERTY.equals( propertyType ) && !mirrorAttributeIsId; return correctAccess || ( !isExplicit && hasId ) || ( !isExplicit && propertyIsDefault ); }
private Access getAccessType(Element tree, XMLContext.Default defaults) { String access = tree == null ? null : tree.attributeValue( "access" ); if ( access != null ) { AnnotationDescriptor ad = new AnnotationDescriptor( Access.class ); AccessType type; try { type = AccessType.valueOf( access ); } catch ( IllegalArgumentException e ) { throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." ); } ad.setValue( "value", type ); return AnnotationFactory.create( ad ); } else if ( defaults.canUseJavaAnnotations() && isPhysicalAnnotationPresent( Access.class ) ) { return getPhysicalAnnotation( Access.class ); } else if ( defaults.getAccess() != null ) { AnnotationDescriptor ad = new AnnotationDescriptor( Access.class ); ad.setValue( "value", defaults.getAccess() ); return AnnotationFactory.create( ad ); } else { return null; } }
private JoinTable overridesDefaultsInJoinTable(Annotation annotation, XMLContext.Default defaults) { boolean defaultToJoinTable = !( isPhysicalAnnotationPresent( JoinColumn.class ) || isPhysicalAnnotationPresent( JoinColumns.class ) ); final Class<? extends Annotation> annotationClass = annotation.annotationType(); defaultToJoinTable = defaultToJoinTable &&
return buildTableGeneratorAnnotation( element, defaults ); else if ( defaults.canUseJavaAnnotations() && isPhysicalAnnotationPresent( TableGenerator.class ) ) { TableGenerator tableAnn = getPhysicalAnnotation( TableGenerator.class ); if ( StringHelper.isNotEmpty( defaults.getSchema() )
addIfNotNull( annotationList, annotation ); else if ( isPhysicalAnnotationPresent( ElementCollection.class ) ) { //JPA2 annotation = overridesDefaultsInJoinTable( getPhysicalAnnotation( ElementCollection.class ), defaults ); addIfNotNull( annotationList, annotation );
private boolean isProcessingId(XMLContext.Default defaults) { boolean isExplicit = defaults.getAccess() != null; boolean correctAccess = ( PropertyType.PROPERTY.equals( propertyType ) && AccessType.PROPERTY.equals( defaults.getAccess() ) ) || ( PropertyType.FIELD.equals( propertyType ) && AccessType.FIELD .equals( defaults.getAccess() ) ); boolean hasId = defaults.canUseJavaAnnotations() && ( isPhysicalAnnotationPresent( Id.class ) || isPhysicalAnnotationPresent( EmbeddedId.class ) ); //if ( properAccessOnMetadataComplete || properOverridingOnMetadataNonComplete ) { boolean mirrorAttributeIsId = defaults.canUseJavaAnnotations() && ( mirroredAttribute != null && ( mirroredAttribute.isAnnotationPresent( Id.class ) || mirroredAttribute.isAnnotationPresent( EmbeddedId.class ) ) ); boolean propertyIsDefault = PropertyType.PROPERTY.equals( propertyType ) && !mirrorAttributeIsId; return correctAccess || ( !isExplicit && hasId ) || ( !isExplicit && propertyIsDefault ); }
private Access getAccessType(Element tree, XMLContext.Default defaults) { String access = tree == null ? null : tree.attributeValue( "access" ); if ( access != null ) { AnnotationDescriptor ad = new AnnotationDescriptor( Access.class ); AccessType type; try { type = AccessType.valueOf( access ); } catch ( IllegalArgumentException e ) { throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." ); } ad.setValue( "value", type ); return AnnotationFactory.create( ad ); } else if ( defaults.canUseJavaAnnotations() && isPhysicalAnnotationPresent( Access.class ) ) { return getPhysicalAnnotation( Access.class ); } else if ( defaults.getAccess() != null ) { AnnotationDescriptor ad = new AnnotationDescriptor( Access.class ); ad.setValue( "value", defaults.getAccess() ); return AnnotationFactory.create( ad ); } else { return null; } }
private JoinTable overridesDefaultsInJoinTable(Annotation annotation, XMLContext.Default defaults) { boolean defaultToJoinTable = !( isPhysicalAnnotationPresent( JoinColumn.class ) || isPhysicalAnnotationPresent( JoinColumns.class ) ); final Class<? extends Annotation> annotationClass = annotation.annotationType(); defaultToJoinTable = defaultToJoinTable &&
return buildTableGeneratorAnnotation( element, defaults ); else if ( defaults.canUseJavaAnnotations() && isPhysicalAnnotationPresent( TableGenerator.class ) ) { TableGenerator tableAnn = getPhysicalAnnotation( TableGenerator.class ); if ( StringHelper.isNotEmpty( defaults.getSchema() )
addIfNotNull( annotationList, annotation ); else if ( isPhysicalAnnotationPresent( ElementCollection.class ) ) { //JPA2 annotation = overridesDefaultsInJoinTable( getPhysicalAnnotation( ElementCollection.class ), defaults ); addIfNotNull( annotationList, annotation );