isDiscriminatorIncludedInSql = true;
}
}
private void processHibernateEntitySpecificAnnotations() {
final AnnotationInstance hibernateEntityAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.ENTITY
);
// see HHH-6400
PolymorphismType polymorphism = PolymorphismType.IMPLICIT;
if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "polymorphism" ) != null ) {
polymorphism = PolymorphismType.valueOf( hibernateEntityAnnotation.value( "polymorphism" ).asEnum() );
}
isExplicitPolymorphism = polymorphism == PolymorphismType.EXPLICIT;
// see HHH-6401
OptimisticLockType optimisticLockType = OptimisticLockType.VERSION;
if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "optimisticLock" ) != null ) {
optimisticLockType = OptimisticLockType.valueOf(
hibernateEntityAnnotation.value( "optimisticLock" )
.asEnum()
);
}
optimisticLockStyle = OptimisticLockStyle.valueOf( optimisticLockType.name() );
final AnnotationInstance hibernateImmutableAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.IMMUTABLE
);
isMutable = hibernateImmutableAnnotation == null
&& hibernateEntityAnnotation != null
&& hibernateEntityAnnotation.value( "mutable" ) != null
&& hibernateEntityAnnotation.value( "mutable" ).asBoolean();
final AnnotationInstance whereAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.WHERE
);
whereClause = whereAnnotation != null && whereAnnotation.value( "clause" ) != null ?
whereAnnotation.value( "clause" ).asString() : null;
final AnnotationInstance rowIdAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.ROW_ID
);
rowId = rowIdAnnotation != null && rowIdAnnotation.value() != null
? rowIdAnnotation.value().asString() : null;
caching = determineCachingSettings();
// see HHH-6397
isDynamicInsert =
hibernateEntityAnnotation != null
&& hibernateEntityAnnotation.value( "dynamicInsert" ) != null
&& hibernateEntityAnnotation.value( "dynamicInsert" ).asBoolean();
// see HHH-6398
isDynamicUpdate =
hibernateEntityAnnotation != null
&& hibernateEntityAnnotation.value( "dynamicUpdate" ) != null
&& hibernateEntityAnnotation.value( "dynamicUpdate" ).asBoolean();
// see HHH-6399
isSelectBeforeUpdate =
hibernateEntityAnnotation != null
&& hibernateEntityAnnotation.value( "selectBeforeUpdate" ) != null
&& hibernateEntityAnnotation.value( "selectBeforeUpdate" ).asBoolean();
// Custom persister
final String entityPersisterClass;
final AnnotationInstance persisterAnnotation = JandexHelper.getSingleAnnotation(
getClassInfo(), HibernateDotNames.PERSISTER
);
if ( persisterAnnotation == null || persisterAnnotation.value( "impl" ) == null ) {
if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "persister" ) != null ) {
entityPersisterClass = hibernateEntityAnnotation.value( "persister" ).asString();
}
else {
entityPersisterClass = null;
}
}
else {
if ( hibernateEntityAnnotation != null && hibernateEntityAnnotation.value( "persister" ) != null ) {
// todo : error?
}
entityPersisterClass = persisterAnnotation.value( "impl" ).asString();
}
this.customPersister = entityPersisterClass;
}