@@ -910,9 +910,7 @@ public boolean isArray() {
910
910
911
911
@ Override
912
912
public String getIdentifierColumnName () {
913
- return collectionSemantics .getCollectionClassification () == CollectionClassification .ID_BAG
914
- ? identifierColumnName
915
- : null ;
913
+ return hasId () ? identifierColumnName : null ;
916
914
}
917
915
918
916
/**
@@ -975,7 +973,7 @@ public String selectFragment(String alias, String columnSuffix) {
975
973
i ++;
976
974
}
977
975
}
978
- if ( collectionSemantics . getCollectionClassification () == CollectionClassification . ID_BAG ) {
976
+ if ( hasId () ) {
979
977
sqlSelections .set (
980
978
i ,
981
979
new SqlSelectionImpl (
@@ -1063,6 +1061,10 @@ public boolean hasIndex() {
1063
1061
return collectionSemantics .getCollectionClassification ().isIndexed ();
1064
1062
}
1065
1063
1064
+ private boolean hasId () {
1065
+ return collectionSemantics .getCollectionClassification () == CollectionClassification .ID_BAG ;
1066
+ }
1067
+
1066
1068
@ Override
1067
1069
public boolean isLazy () {
1068
1070
return isLazy ;
@@ -1394,7 +1396,7 @@ public void initCollectionPropertyMap() {
1394
1396
if ( hasIndex () ) {
1395
1397
initCollectionPropertyMap ( "index" , indexType , indexColumnAliases );
1396
1398
}
1397
- if ( collectionSemantics . getCollectionClassification () == CollectionClassification . ID_BAG ) {
1399
+ if ( hasId () ) {
1398
1400
initCollectionPropertyMap ( "id" , identifierType , new String [] { identifierColumnAlias } );
1399
1401
}
1400
1402
}
@@ -1856,21 +1858,11 @@ public String[] getElementColumnAliases(String suffix) {
1856
1858
1857
1859
@ Override
1858
1860
public String [] getIndexColumnAliases (String suffix ) {
1859
- if ( hasIndex () ) {
1860
- return new Alias ( suffix ).toAliasStrings ( indexColumnAliases );
1861
- }
1862
- else {
1863
- return null ;
1864
- }
1861
+ return hasIndex () ? new Alias ( suffix ).toAliasStrings ( indexColumnAliases ) : null ;
1865
1862
}
1866
1863
1867
1864
@ Override
1868
1865
public String getIdentifierColumnAlias (String suffix ) {
1869
- if ( collectionSemantics .getCollectionClassification () == CollectionClassification .ID_BAG ) {
1870
- return new Alias ( suffix ).toAliasString ( identifierColumnAlias );
1871
- }
1872
- else {
1873
- return null ;
1874
- }
1866
+ return hasId () ? new Alias ( suffix ).toAliasString ( identifierColumnAlias ) : null ;
1875
1867
}
1876
1868
}
0 commit comments