Skip to content

Commit 853b76a

Browse files
committed
remove some obsolete code
1 parent 7bd857c commit 853b76a

File tree

4 files changed

+3
-35
lines changed

4 files changed

+3
-35
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumn.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static AnnotatedJoinColumn buildJoinColumn(
8282
throw new AnnotationException( "Property '" + path
8383
+ "' overrides mapping specified using '@JoinColumnOrFormula'" );
8484
}
85-
return buildJoinColumn( joinColumn, /*null,*/ mappedBy, parent, propertyHolder, inferredData, "" );
85+
return buildJoinColumn( joinColumn, mappedBy, parent, propertyHolder, inferredData, "" );
8686
}
8787

8888
public static AnnotatedJoinColumn buildJoinFormula(
@@ -102,7 +102,6 @@ public static AnnotatedJoinColumn buildJoinFormula(
102102

103103
static AnnotatedJoinColumn buildJoinColumn(
104104
JoinColumn joinColumn,
105-
// Comment comment,
106105
String mappedBy,
107106
AnnotatedJoinColumns parent,
108107
PropertyHolder propertyHolder,
@@ -114,7 +113,7 @@ static AnnotatedJoinColumn buildJoinColumn(
114113
+ getRelativePath( propertyHolder, inferredData.getPropertyName() )
115114
+ "' is 'mappedBy' a different entity and may not explicitly specify the '@JoinColumn'" );
116115
}
117-
return explicitJoinColumn( joinColumn, /*comment,*/ parent, inferredData, defaultColumnSuffix );
116+
return explicitJoinColumn( joinColumn, parent, inferredData, defaultColumnSuffix );
118117
}
119118
else {
120119
return implicitJoinColumn( parent, inferredData, defaultColumnSuffix );
@@ -123,12 +122,10 @@ static AnnotatedJoinColumn buildJoinColumn(
123122

124123
private static AnnotatedJoinColumn explicitJoinColumn(
125124
JoinColumn joinColumn,
126-
// Comment comment,
127125
AnnotatedJoinColumns parent,
128126
PropertyData inferredData,
129127
String defaultColumnSuffix) {
130128
final AnnotatedJoinColumn column = new AnnotatedJoinColumn();
131-
// column.setComment( comment != null ? comment.value() : null );
132129
// column.setContext( context );
133130
// column.setJoins( joins );
134131
// column.setPropertyHolder( propertyHolder );
@@ -290,15 +287,6 @@ private static AnnotatedJoinColumn buildImplicitInheritanceJoinColumn(
290287
return column;
291288
}
292289

293-
public static void checkIfJoinColumn(Object columns, PropertyHolder holder, PropertyData property) {
294-
if ( !( columns instanceof AnnotatedJoinColumn[] ) ) {
295-
throw new AnnotationException(
296-
"Property '" + getRelativePath( holder, property.getPropertyName() )
297-
+ "' is an association and may not use '@Column' to specify column mappings (use '@JoinColumn' instead)"
298-
);
299-
}
300-
}
301-
302290
public void copyReferencedStructureAndCreateDefaultJoinColumns(
303291
PersistentClass referencedEntity,
304292
SimpleValue referencedValue,
@@ -386,14 +374,8 @@ private String defaultColumnName(int columnIndex, PersistentClass referencedEnti
386374
// }
387375
}
388376

389-
public void addDefaultJoinColumnName(PersistentClass referencedEntity, String logicalReferencedColumn) {
390-
final String columnName = getParent().buildDefaultColumnName( referencedEntity, logicalReferencedColumn );
391-
getMappingColumn().setName( columnName );
392-
setLogicalColumnName( columnName );
393-
}
394-
395377
/**
396-
* used for mappedBy cases
378+
* Used for {@code mappedBy} cases.
397379
*/
398380
public void linkValueUsingAColumnCopy(Column column, SimpleValue value) {
399381
initMappingColumn(

hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumns.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,13 @@ static AnnotatedJoinColumns buildJoinColumnsWithFormula(
138138

139139
public static AnnotatedJoinColumns buildJoinColumns(
140140
JoinColumn[] joinColumns,
141-
// Comment comment,
142141
String mappedBy,
143142
Map<String, Join> joins,
144143
PropertyHolder propertyHolder,
145144
PropertyData inferredData,
146145
MetadataBuildingContext buildingContext) {
147146
return buildJoinColumnsWithDefaultColumnSuffix(
148147
joinColumns,
149-
// comment,
150148
mappedBy,
151149
joins,
152150
propertyHolder,
@@ -158,7 +156,6 @@ public static AnnotatedJoinColumns buildJoinColumns(
158156

159157
public static AnnotatedJoinColumns buildJoinColumnsWithDefaultColumnSuffix(
160158
JoinColumn[] joinColumns,
161-
// Comment comment,
162159
String mappedBy,
163160
Map<String, Join> joins,
164161
PropertyHolder propertyHolder,
@@ -180,7 +177,6 @@ public static AnnotatedJoinColumns buildJoinColumnsWithDefaultColumnSuffix(
180177
if ( isEmpty( actualColumns ) ) {
181178
AnnotatedJoinColumn.buildJoinColumn(
182179
null,
183-
// comment,
184180
mappedBy,
185181
parent,
186182
propertyHolder,
@@ -193,7 +189,6 @@ public static AnnotatedJoinColumns buildJoinColumnsWithDefaultColumnSuffix(
193189
for ( JoinColumn actualColumn : actualColumns ) {
194190
AnnotatedJoinColumn.buildJoinColumn(
195191
actualColumn,
196-
// comment,
197192
mappedBy,
198193
parent,
199194
propertyHolder,

hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ public static void bindCollection(
242242
collectionBinder.setInheritanceStatePerClass( inheritanceStatePerClass );
243243
collectionBinder.setDeclaringClass( inferredData.getDeclaringClass() );
244244

245-
// final Comment comment = property.getAnnotation( Comment.class );
246245
final Cascade hibernateCascade = property.getAnnotationUsage( Cascade.class, modelsContext );
247246

248247
collectionBinder.setElementColumns( elementColumns(
@@ -261,7 +260,6 @@ public static void bindCollection(
261260
entityBinder,
262261
context,
263262
property
264-
// comment
265263
) );
266264

267265
collectionBinder.setMapKeyManyToManyColumns( mapKeyJoinColumns(
@@ -270,7 +268,6 @@ public static void bindCollection(
270268
entityBinder,
271269
context,
272270
property
273-
// comment
274271
) );
275272

276273
bindJoinedTableAssociation(
@@ -351,10 +348,8 @@ private static AnnotatedJoinColumns mapKeyJoinColumns(
351348
EntityBinder entityBinder,
352349
MetadataBuildingContext context,
353350
MemberDetails property) {
354-
// Comment comment) {
355351
return buildJoinColumnsWithDefaultColumnSuffix(
356352
mapKeyJoinColumnAnnotations( property, context ),
357-
// comment,
358353
null,
359354
entityBinder.getSecondaryTables(),
360355
propertyHolder,

hibernate-core/src/main/java/org/hibernate/boot/model/internal/ColumnsBuilder.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ else if ( joinColumns == null
133133
OneToMany oneToMany = property.getDirectAnnotationUsage( OneToMany.class );
134134
joinColumns = AnnotatedJoinColumns.buildJoinColumns(
135135
null,
136-
// comment,
137136
oneToMany == null ? null : nullIfEmpty( oneToMany.mappedBy() ),
138137
entityBinder.getSecondaryTables(),
139138
propertyHolder,
@@ -172,11 +171,9 @@ private AnnotatedJoinColumns buildDefaultJoinColumnsForToOne(
172171
MemberDetails property,
173172
PropertyData inferredData) {
174173
final JoinTable joinTableAnn = propertyHolder.getJoinTable( property );
175-
// final Comment comment = property.getAnnotation(Comment.class);
176174
if ( joinTableAnn != null ) {
177175
return AnnotatedJoinColumns.buildJoinColumns(
178176
joinTableAnn.inverseJoinColumns(),
179-
// comment,
180177
null,
181178
entityBinder.getSecondaryTables(),
182179
propertyHolder,
@@ -188,7 +185,6 @@ private AnnotatedJoinColumns buildDefaultJoinColumnsForToOne(
188185
final OneToOne oneToOneAnn = property.getDirectAnnotationUsage( OneToOne.class );
189186
return AnnotatedJoinColumns.buildJoinColumns(
190187
null,
191-
// comment,
192188
oneToOneAnn == null ? null : nullIfEmpty( oneToOneAnn.mappedBy() ),
193189
entityBinder.getSecondaryTables(),
194190
propertyHolder,

0 commit comments

Comments
 (0)