private void getJoinTable(List<Annotation> annotationList, Element tree, XMLContext.Default defaults) { addIfNotNull( annotationList, buildJoinTable( tree, defaults ) ); }
private void getEmbedded(List<Annotation> annotationList, XMLContext.Default defaults) { for ( Element element : elementsForProperty ) { if ( "embedded".equals( element.getName() ) ) { AnnotationDescriptor ad = new AnnotationDescriptor( Embedded.class ); annotationList.add( AnnotationFactory.create( ad ) ); Annotation annotation = getAttributeOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); getAccessType( annotationList, element ); } } if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) { Annotation annotation = getPhysicalAnnotation( Embedded.class ); if ( annotation != null ) { annotationList.add( annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation ); } } }
if ( isProcessingId( defaults ) ) { Annotation annotation = getAttributeOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); AnnotationDescriptor ad = new AnnotationDescriptor( EmbeddedId.class ); annotationList.add( AnnotationFactory.create( ad ) ); annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( GeneratedValue.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( TableGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( SequenceGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation );
if ( processId ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); annotation = buildGeneratedValue( element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); addIfNotNull( annotationList, annotation ); annotation = getSequenceGenerator( element, defaults ); addIfNotNull( annotationList, annotation ); AnnotationDescriptor id = new AnnotationDescriptor( Id.class ); annotationList.add( AnnotationFactory.create( id ) ); annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( GeneratedValue.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( TableGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( SequenceGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class );
private void getVersion(List<Annotation> annotationList, XMLContext.Default defaults) { for ( Element element : elementsForProperty ) { if ( "version".equals( element.getName() ) ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); AnnotationDescriptor basic = new AnnotationDescriptor( Version.class ); annotationList.add( AnnotationFactory.create( basic ) ); getAccessType( annotationList, element ); } } if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) { //we have nothing, so Java annotations might occurs Annotation annotation = getPhysicalAnnotation( Version.class ); if ( annotation != null ) { annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); } } }
if ( "basic".equals( element.getName() ) ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); getAccessType( annotationList, element ); getTemporal( annotationList, element ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Lob.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Enumerated.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation );
addIfNotNull( annotationList, getEntity( tree, defaults ) ); addIfNotNull( annotationList, getMappedSuperclass( tree, defaults ) ); addIfNotNull( annotationList, getEmbeddable( tree, defaults ) ); addIfNotNull( annotationList, getTable( tree, defaults ) ); addIfNotNull( annotationList, getSecondaryTables( tree, defaults ) ); addIfNotNull( annotationList, getPrimaryKeyJoinColumns( tree, defaults, true ) ); addIfNotNull( annotationList, getIdClass( tree, defaults ) ); addIfNotNull( annotationList, getCacheable( tree, defaults ) ); addIfNotNull( annotationList, getInheritance( tree, defaults ) ); addIfNotNull( annotationList, getDiscriminatorValue( tree, defaults ) ); addIfNotNull( annotationList, getDiscriminatorColumn( tree, defaults ) ); addIfNotNull( annotationList, getSequenceGenerator( tree, defaults ) ); addIfNotNull( annotationList, getTableGenerator( tree, defaults ) ); addIfNotNull( annotationList, getNamedQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedNativeQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedStoredProcedureQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedEntityGraphs( tree, defaults ) ); addIfNotNull( annotationList, getSqlResultSetMappings( tree, defaults ) ); addIfNotNull( annotationList, getExcludeDefaultListeners( tree, defaults ) ); addIfNotNull( annotationList, getExcludeSuperclassListeners( tree, defaults ) ); addIfNotNull( annotationList, getAccessType( tree, defaults ) ); addIfNotNull( annotationList, getAttributeOverrides( tree, defaults, true ) ); addIfNotNull( annotationList, getAssociationOverrides( tree, defaults, true ) ); addIfNotNull( annotationList, getEntityListeners( tree, defaults ) ); addIfNotNull( annotationList, getConverts( tree, defaults ) ); if ( defaults.canUseJavaAnnotations() ) { Annotation annotation = getPhysicalAnnotation( Access.class ); addIfNotNull( annotationList, annotation );
buildJoinColumns( annotationList, element ); Annotation annotation = getPrimaryKeyJoinColumns( element, defaults, false ); addIfNotNull( annotationList, annotation ); copyBooleanAttribute( ad, element, "optional" ); copyBooleanAttribute( ad, element, "orphan-removal" ); getMapKeyEnumerated( annotationList, element ); annotation = getMapKeyAttributeOverrides( element, defaults ); addIfNotNull( annotationList, annotation ); buildMapKeyJoinColumns( annotationList, element ); getAssociationId( annotationList, element ); annotationList.add( annotation ); annotation = overridesDefaultsInJoinTable( annotation, defaults ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( JoinColumn.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( JoinColumns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( PrimaryKeyJoinColumn.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( PrimaryKeyJoinColumns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( MapKey.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( OrderBy.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation );
addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PreRemove.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PreUpdate.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostPersist.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostRemove.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostUpdate.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostLoad.class ); addIfNotNull( annotationList, ann );
buildMapKeyJoinColumns( annotationList, element ); Annotation annotation = getColumn( element.element( "column" ), false, element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); getEnumerated( annotationList, element ); attributes.addAll( buildAttributeOverrides( element, "attribute-override" ) ); annotation = mergeAttributeOverrides( defaults, attributes, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); getCollectionTable( annotationList, element, defaults ); annotationList.add( AnnotationFactory.create( ad ) );
private void getJoinTable(List<Annotation> annotationList, Element tree, XMLContext.Default defaults) { addIfNotNull( annotationList, buildJoinTable( tree, defaults ) ); }
private void getEmbedded(List<Annotation> annotationList, XMLContext.Default defaults) { for ( Element element : elementsForProperty ) { if ( "embedded".equals( element.getName() ) ) { AnnotationDescriptor ad = new AnnotationDescriptor( Embedded.class ); annotationList.add( AnnotationFactory.create( ad ) ); Annotation annotation = getAttributeOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); getAccessType( annotationList, element ); } } if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) { Annotation annotation = getPhysicalAnnotation( Embedded.class ); if ( annotation != null ) { annotationList.add( annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation ); } } }
private void getVersion(List<Annotation> annotationList, XMLContext.Default defaults) { for ( Element element : elementsForProperty ) { if ( "version".equals( element.getName() ) ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); AnnotationDescriptor basic = new AnnotationDescriptor( Version.class ); annotationList.add( AnnotationFactory.create( basic ) ); getAccessType( annotationList, element ); } } if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) { //we have nothing, so Java annotations might occurs Annotation annotation = getPhysicalAnnotation( Version.class ); if ( annotation != null ) { annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); } } }
if ( isProcessingId( defaults ) ) { Annotation annotation = getAttributeOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); AnnotationDescriptor ad = new AnnotationDescriptor( EmbeddedId.class ); annotationList.add( AnnotationFactory.create( ad ) ); annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( GeneratedValue.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( TableGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( SequenceGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation );
if ( processId ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); annotation = buildGeneratedValue( element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); addIfNotNull( annotationList, annotation ); annotation = getSequenceGenerator( element, defaults ); addIfNotNull( annotationList, annotation ); AnnotationDescriptor id = new AnnotationDescriptor( Id.class ); annotationList.add( AnnotationFactory.create( id ) ); annotationList.add( annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( GeneratedValue.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( TableGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( SequenceGenerator.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class );
if ( "basic".equals( element.getName() ) ) { Annotation annotation = buildColumns( element ); addIfNotNull( annotationList, annotation ); getAccessType( annotationList, element ); getTemporal( annotationList, element ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Lob.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Enumerated.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Temporal.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Column.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( Columns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverrides.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverride.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AssociationOverrides.class ); addIfNotNull( annotationList, annotation );
addIfNotNull( annotationList, getEntity( tree, defaults ) ); addIfNotNull( annotationList, getMappedSuperclass( tree, defaults ) ); addIfNotNull( annotationList, getEmbeddable( tree, defaults ) ); addIfNotNull( annotationList, getTable( tree, defaults ) ); addIfNotNull( annotationList, getSecondaryTables( tree, defaults ) ); addIfNotNull( annotationList, getPrimaryKeyJoinColumns( tree, defaults, true ) ); addIfNotNull( annotationList, getIdClass( tree, defaults ) ); addIfNotNull( annotationList, getCacheable( tree, defaults ) ); addIfNotNull( annotationList, getInheritance( tree, defaults ) ); addIfNotNull( annotationList, getDiscriminatorValue( tree, defaults ) ); addIfNotNull( annotationList, getDiscriminatorColumn( tree, defaults ) ); addIfNotNull( annotationList, getSequenceGenerator( tree, defaults ) ); addIfNotNull( annotationList, getTableGenerator( tree, defaults ) ); addIfNotNull( annotationList, getNamedQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedNativeQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedStoredProcedureQueries( tree, defaults ) ); addIfNotNull( annotationList, getNamedEntityGraphs( tree, defaults ) ); addIfNotNull( annotationList, getSqlResultSetMappings( tree, defaults ) ); addIfNotNull( annotationList, getExcludeDefaultListeners( tree, defaults ) ); addIfNotNull( annotationList, getExcludeSuperclassListeners( tree, defaults ) ); addIfNotNull( annotationList, getAccessType( tree, defaults ) ); addIfNotNull( annotationList, getAttributeOverrides( tree, defaults, true ) ); addIfNotNull( annotationList, getAssociationOverrides( tree, defaults, true ) ); addIfNotNull( annotationList, getEntityListeners( tree, defaults ) ); addIfNotNull( annotationList, getConverts( tree, defaults ) ); if ( defaults.canUseJavaAnnotations() ) { Annotation annotation = getPhysicalAnnotation( Access.class ); addIfNotNull( annotationList, annotation );
addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PreRemove.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PreUpdate.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostPersist.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostRemove.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostUpdate.class ); addIfNotNull( annotationList, ann ); ann = getPhysicalAnnotation( PostLoad.class ); addIfNotNull( annotationList, ann );
buildJoinColumns( annotationList, element ); Annotation annotation = getPrimaryKeyJoinColumns( element, defaults, false ); addIfNotNull( annotationList, annotation ); copyBooleanAttribute( ad, element, "optional" ); copyBooleanAttribute( ad, element, "orphan-removal" ); getMapKeyEnumerated( annotationList, element ); annotation = getMapKeyAttributeOverrides( element, defaults ); addIfNotNull( annotationList, annotation ); buildMapKeyJoinColumns( annotationList, element ); getAssociationId( annotationList, element ); annotationList.add( annotation ); annotation = overridesDefaultsInJoinTable( annotation, defaults ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( JoinColumn.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( JoinColumns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( PrimaryKeyJoinColumn.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( PrimaryKeyJoinColumns.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( MapKey.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( OrderBy.class ); addIfNotNull( annotationList, annotation ); annotation = getPhysicalAnnotation( AttributeOverride.class ); addIfNotNull( annotationList, annotation );
buildMapKeyJoinColumns( annotationList, element ); Annotation annotation = getColumn( element.element( "column" ), false, element ); addIfNotNull( annotationList, annotation ); getTemporal( annotationList, element ); getEnumerated( annotationList, element ); attributes.addAll( buildAttributeOverrides( element, "attribute-override" ) ); annotation = mergeAttributeOverrides( defaults, attributes, false ); addIfNotNull( annotationList, annotation ); annotation = getAssociationOverrides( element, defaults, false ); addIfNotNull( annotationList, annotation ); getCollectionTable( annotationList, element, defaults ); annotationList.add( AnnotationFactory.create( ad ) );