private void getId(List<Annotation> annotationList, XMLContext.Default defaults) {
for ( Element element : elementsForProperty ) {
if ( "id".equals( element.getName() ) ) {
boolean processId = isProcessingId( defaults );
if ( processId ) {
Annotation annotation = buildColumns( element );
addIfNotNull( annotationList, annotation );
annotation = buildGeneratedValue( element );
addIfNotNull( annotationList, annotation );
getTemporal( annotationList, element );
//FIXME: fix the priority of xml over java for generator names
annotation = getTableGenerator( element, defaults );
addIfNotNull( annotationList, annotation );
annotation = getSequenceGenerator( element, defaults );
addIfNotNull( annotationList, annotation );
AnnotationDescriptor id = new AnnotationDescriptor( Id.class );
annotationList.add( AnnotationFactory.create( id ) );
getAccessType( annotationList, element );
}
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
Annotation annotation = getJavaAnnotation( Id.class );
if ( annotation != null ) {
annotationList.add( annotation );
annotation = getJavaAnnotation( Column.class );
addIfNotNull( annotationList, annotation );
annotation = getJavaAnnotation( Columns.class );