@@ -91,7 +91,6 @@ public ColumnsBuilder extractMetadata() {
9191 columns = buildColumnFromAnnotation (
9292 columnAnn ,
9393 property .getDirectAnnotationUsage ( FractionalSeconds .class ),
94- // comment,
9594 nullability ,
9695 propertyHolder ,
9796 inferredData ,
@@ -149,7 +148,6 @@ else if ( joinColumns == null
149148 //useful for collection of embedded elements
150149 columns = buildColumnFromNoAnnotation (
151150 property .getDirectAnnotationUsage ( FractionalSeconds .class ),
152- // comment,
153151 nullability ,
154152 propertyHolder ,
155153 inferredData ,
@@ -196,7 +194,7 @@ private AnnotatedJoinColumns buildDefaultJoinColumnsForToOne(
196194
197195 private AnnotatedJoinColumns buildExplicitJoinColumns (MemberDetails property , PropertyData inferredData ) {
198196 // process @JoinColumns before @Columns to handle collection of entities properly
199- final JoinColumn [] joinColumnAnnotations = getJoinColumnAnnotations ( property , inferredData );
197+ final JoinColumn [] joinColumnAnnotations = getJoinColumnAnnotations ( property );
200198 if ( joinColumnAnnotations != null ) {
201199 return AnnotatedJoinColumns .buildJoinColumns (
202200 joinColumnAnnotations ,
@@ -208,7 +206,7 @@ private AnnotatedJoinColumns buildExplicitJoinColumns(MemberDetails property, Pr
208206 );
209207 }
210208
211- final JoinColumnOrFormula [] joinColumnOrFormulaAnnotations = joinColumnOrFormulaAnnotations ( property , inferredData );
209+ final JoinColumnOrFormula [] joinColumnOrFormulaAnnotations = joinColumnOrFormulaAnnotations ( property );
212210 if ( joinColumnOrFormulaAnnotations != null ) {
213211 return AnnotatedJoinColumns .buildJoinColumnsOrFormulas (
214212 joinColumnOrFormulaAnnotations ,
@@ -234,20 +232,16 @@ private AnnotatedJoinColumns buildExplicitJoinColumns(MemberDetails property, Pr
234232 return null ;
235233 }
236234
237- private JoinColumnOrFormula [] joinColumnOrFormulaAnnotations (MemberDetails property , PropertyData inferredData ) {
235+ private JoinColumnOrFormula [] joinColumnOrFormulaAnnotations (MemberDetails property ) {
238236 final ModelsContext modelsContext = buildingContext .getBootstrapContext ().getModelsContext ();
239237 final JoinColumnOrFormula [] annotations = property .getRepeatedAnnotationUsages (
240238 HibernateAnnotations .JOIN_COLUMN_OR_FORMULA ,
241239 modelsContext
242240 );
243- if ( isNotEmpty ( annotations ) ) {
244- return annotations ;
245- }
246-
247- return null ;
241+ return isNotEmpty ( annotations ) ? annotations : null ;
248242 }
249243
250- private JoinColumn [] getJoinColumnAnnotations (MemberDetails property , PropertyData inferredData ) {
244+ private JoinColumn [] getJoinColumnAnnotations (MemberDetails property ) {
251245 final ModelsContext modelsContext = buildingContext .getBootstrapContext ().getModelsContext ();
252246
253247 final JoinColumn [] joinColumns = property .getRepeatedAnnotationUsages (
@@ -257,8 +251,7 @@ private JoinColumn[] getJoinColumnAnnotations(MemberDetails property, PropertyDa
257251 if ( isNotEmpty ( joinColumns ) ) {
258252 return joinColumns ;
259253 }
260-
261- if ( property .hasDirectAnnotationUsage ( MapsId .class ) ) {
254+ else if ( property .hasDirectAnnotationUsage ( MapsId .class ) ) {
262255 // inelegant solution to HHH-16463, let the PrimaryKeyJoinColumn
263256 // masquerade as a regular JoinColumn (when a @OneToOne maps to
264257 // the primary key of the child table, it's more elegant and more
@@ -275,19 +268,24 @@ private JoinColumn[] getJoinColumnAnnotations(MemberDetails property, PropertyDa
275268 }
276269 return adapters ;
277270 }
271+ else {
272+ return null ;
273+ }
274+ }
275+ else {
276+ return null ;
278277 }
279-
280- return null ;
281278 }
282279
283280 /**
284281 * Useful to override a column either by {@code @MapsId} or by {@code @IdClass}
285282 */
286283 AnnotatedColumns overrideColumnFromMapperOrMapsIdProperty (PropertyData override ) {
287284 if ( override != null ) {
288- final AnnotatedJoinColumns joinColumns = buildExplicitJoinColumns ( override .getAttributeMember (), override );
285+ final MemberDetails attributeMember = override .getAttributeMember ();
286+ final AnnotatedJoinColumns joinColumns = buildExplicitJoinColumns ( attributeMember , override );
289287 return joinColumns == null
290- ? buildDefaultJoinColumnsForToOne ( override . getAttributeMember () , override )
288+ ? buildDefaultJoinColumnsForToOne ( attributeMember , override )
291289 : joinColumns ;
292290 }
293291 else {
0 commit comments