Skip to content

Commit 7c594d1

Browse files
marko-bekhtasebersole
authored andcommitted
HHH-18488 Remove table-information-group attribute group in hbm mapping
- just use a list of attributes instead of the group.
1 parent cf6d961 commit 7c594d1

File tree

4 files changed

+33
-30
lines changed

4 files changed

+33
-30
lines changed

hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/spi/TableInformationContainer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ public interface TableInformationContainer {
2020

2121
String getSubselect();
2222

23-
String getSubselectAttribute();
2423
}

hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/Helper.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ public static TableSpecificationSource createTableSource(
185185
String rowId,
186186
String comment,
187187
String checkConstraint) {
188-
if ( StringHelper.isEmpty( tableInformationContainer.getSubselectAttribute() )
189-
&& StringHelper.isEmpty( tableInformationContainer.getSubselect() ) ) {
188+
if ( StringHelper.isEmpty( tableInformationContainer.getSubselect() ) ) {
190189
return new TableSourceImpl(
191190
mappingDocument,
192191
tableInformationContainer.getSchema(),
@@ -202,9 +201,7 @@ public static TableSpecificationSource createTableSource(
202201
mappingDocument,
203202
tableInformationContainer.getSchema(),
204203
tableInformationContainer.getCatalog(),
205-
tableInformationContainer.getSubselectAttribute() != null
206-
? tableInformationContainer.getSubselectAttribute()
207-
: tableInformationContainer.getSubselect(),
204+
tableInformationContainer.getSubselect(),
208205
tableInformationContainer.getTable() == null
209206
? inLineViewNameInferrer.inferInLineViewName()
210207
: tableInformationContainer.getTable(),

hibernate-core/src/main/resources/org/hibernate/xsd/mapping/legacy-mapping-4.0.xsd

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@
493493
<xs:group ref="NamedQueryGroup"/>
494494
</xs:choice>
495495
</xs:sequence>
496-
<xs:attributeGroup ref="table-information-group"/>
496+
<xs:attribute name="schema" type="xs:string"/>
497+
<xs:attribute name="catalog" type="xs:string"/>
498+
<xs:attribute name="table" type="xs:string"/>
497499
<xs:attribute name="check" type="xs:string"/>
498500
<xs:attribute name="discriminator-value" type="xs:string" />
499501
</xs:extension>
@@ -542,7 +544,9 @@
542544
<xs:group ref="NamedQueryGroup"/>
543545
</xs:choice>
544546
</xs:sequence>
545-
<xs:attributeGroup ref="table-information-group"/>
547+
<xs:attribute name="schema" type="xs:string"/>
548+
<xs:attribute name="catalog" type="xs:string"/>
549+
<xs:attribute name="table" type="xs:string"/>
546550
<xs:attribute name="check" type="xs:string"/>
547551
</xs:extension>
548552
</xs:complexContent>
@@ -746,7 +750,9 @@
746750
<xs:group ref="CustomSqlDmlCollectionGroup"/>
747751
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
748752
</xs:sequence>
749-
<xs:attributeGroup ref="table-information-group"/>
753+
<xs:attribute name="schema" type="xs:string"/>
754+
<xs:attribute name="catalog" type="xs:string"/>
755+
<xs:attribute name="table" type="xs:string"/>
750756
<xs:attributeGroup ref="plural-basic-attribute-group"/>
751757
<xs:attribute name="embed-xml" type="xs:boolean"/>
752758
<xs:attribute name="fetch" type="FetchStyleWithSubselectEnum"/>
@@ -792,7 +798,9 @@
792798
<xs:group ref="CustomSqlDmlCollectionGroup"/>
793799
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
794800
</xs:sequence>
795-
<xs:attributeGroup ref="table-information-group"/>
801+
<xs:attribute name="schema" type="xs:string"/>
802+
<xs:attribute name="catalog" type="xs:string"/>
803+
<xs:attribute name="table" type="xs:string"/>
796804
<xs:attribute name="access" type="xs:string"/>
797805
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
798806
<xs:attribute name="cascade" type="xs:string"/>
@@ -832,7 +840,9 @@
832840
<xs:group ref="CustomSqlDmlCollectionGroup"/>
833841
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
834842
</xs:sequence>
835-
<xs:attributeGroup ref="table-information-group"/>
843+
<xs:attribute name="schema" type="xs:string"/>
844+
<xs:attribute name="catalog" type="xs:string"/>
845+
<xs:attribute name="table" type="xs:string"/>
836846
<xs:attributeGroup ref="plural-basic-attribute-group"/>
837847
<xs:attribute name="embed-xml" type="xs:boolean"/>
838848
<xs:attribute name="fetch" type="FetchStyleWithSubselectEnum"/>
@@ -864,7 +874,9 @@
864874
<xs:group ref="CustomSqlDmlCollectionGroup"/>
865875
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
866876
</xs:sequence>
867-
<xs:attributeGroup ref="table-information-group"/>
877+
<xs:attribute name="schema" type="xs:string"/>
878+
<xs:attribute name="catalog" type="xs:string"/>
879+
<xs:attribute name="table" type="xs:string"/>
868880
<xs:attributeGroup ref="plural-basic-attribute-group"/>
869881
<xs:attribute name="embed-xml" type="xs:boolean"/>
870882
<xs:attribute name="fetch" type="FetchStyleWithSubselectEnum"/>
@@ -899,7 +911,9 @@
899911
<xs:group ref="CustomSqlDmlCollectionGroup"/>
900912
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
901913
</xs:sequence>
902-
<xs:attributeGroup ref="table-information-group"/>
914+
<xs:attribute name="schema" type="xs:string"/>
915+
<xs:attribute name="catalog" type="xs:string"/>
916+
<xs:attribute name="table" type="xs:string"/>
903917
<xs:attributeGroup ref="plural-basic-attribute-group"/>
904918
<xs:attribute name="embed-xml" type="xs:boolean"/>
905919
<xs:attribute name="fetch" type="FetchStyleWithSubselectEnum"/>
@@ -929,7 +943,9 @@
929943
<xs:group ref="CustomSqlDmlCollectionGroup"/>
930944
<xs:element name="filter" minOccurs="0" maxOccurs="unbounded" type="filter-type"/>
931945
</xs:sequence>
932-
<xs:attributeGroup ref="table-information-group"/>
946+
<xs:attribute name="schema" type="xs:string"/>
947+
<xs:attribute name="catalog" type="xs:string"/>
948+
<xs:attribute name="table" type="xs:string"/>
933949
<xs:attributeGroup ref="plural-basic-attribute-group"/>
934950
<xs:attribute name="embed-xml" type="xs:boolean"/>
935951
<xs:attribute name="fetch" type="FetchStyleWithSubselectEnum"/>
@@ -1386,7 +1402,9 @@
13861402
</xs:choice>
13871403
<xs:group ref="CustomSqlDmlGroup"/>
13881404
</xs:sequence>
1389-
<xs:attributeGroup ref="table-information-group"/>
1405+
<xs:attribute name="schema" type="xs:string"/>
1406+
<xs:attribute name="catalog" type="xs:string"/>
1407+
<xs:attribute name="table" type="xs:string"/>
13901408
<xs:attribute name="fetch" default="join" type="FetchStyleEnum"/>
13911409
<xs:attribute name="inverse" default="false" type="xs:boolean"/>
13921410
<xs:attribute name="optional" default="false" type="xs:boolean"/>
@@ -1634,7 +1652,9 @@
16341652
<xs:element name="loader" minOccurs="0" type="loader-type"/>
16351653
<xs:group ref="CustomSqlDmlCollectionGroup"/>
16361654
</xs:sequence>
1637-
<xs:attributeGroup ref="table-information-group"/>
1655+
<xs:attribute name="schema" type="xs:string"/>
1656+
<xs:attribute name="catalog" type="xs:string"/>
1657+
<xs:attribute name="table" type="xs:string"/>
16381658
<xs:attribute name="access" type="xs:string"/>
16391659
<xs:attribute name="batch-size" default="-1" type="xs:int"/>
16401660
<xs:attribute name="check" type="xs:string"/>
@@ -1853,15 +1873,6 @@
18531873
<xs:attribute name="collection-type" type="xs:string"/>
18541874
<xs:attribute name="persister" type="ClassNameType"/>
18551875
</xs:attributeGroup>
1856-
<xs:attributeGroup name="table-information-group">
1857-
<xs:attribute name="schema" type="xs:string"/>
1858-
<xs:attribute name="catalog" type="xs:string"/>
1859-
<xs:attribute name="table" type="xs:string"/>
1860-
<!-- default: unqualified class name -->
1861-
<xs:attribute name="subselect" type="xs:string"/>
1862-
</xs:attributeGroup>
1863-
1864-
18651876

18661877
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
18671878
<!-- Enums -->

hibernate-core/src/main/xjb/hbm-mapping-bindings.xjb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,6 @@
375375
<jaxb:property name="columnAttribute"/>
376376
</jaxb:bindings>
377377

378-
<jaxb:bindings node="//xsd:attributeGroup[@name='table-information-group']//xsd:attribute[@name='subselect']">
379-
<jaxb:property name="subselectAttribute"/>
380-
</jaxb:bindings>
381-
382378
<jaxb:bindings node="//xsd:complexType[@name='multi-tenancy-type']//xsd:attribute[@name='column']">
383379
<jaxb:property name="columnAttribute"/>
384380
</jaxb:bindings>
@@ -395,4 +391,4 @@
395391
<jaxb:serializable />
396392
</jaxb:globalBindings>
397393

398-
</jaxb:bindings>
394+
</jaxb:bindings>

0 commit comments

Comments
 (0)