Skip to content

Commit 529a3e2

Browse files
author
Nikolay Shestakov
committed
HHH-7772 Remove obsolete Type, AssociationType, and TypeFactory methods
1 parent 542aa17 commit 529a3e2

30 files changed

+9
-582
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/HbmBinder.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,15 +1402,6 @@ public static void bindCollection(Element node, Collection collection, String cl
14021402
String nodeName = node.attributeValue( "node" );
14031403
if ( nodeName == null ) nodeName = node.attributeValue( "name" );
14041404
collection.setNodeName( nodeName );
1405-
String embed = node.attributeValue( "embed-xml" );
1406-
// sometimes embed is set to the default value when not specified in the mapping,
1407-
// so can't seem to determine if an attribute was explicitly set;
1408-
// log a warning if embed has a value different from the default.
1409-
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
1410-
LOG.embedXmlAttributesNoLongerSupported();
1411-
}
1412-
collection.setEmbedded( embed==null || "true".equals(embed) );
1413-
14141405

14151406
// PERSISTER
14161407
Attribute persisterNode = node.attribute( "persister" );
@@ -1631,15 +1622,6 @@ public static void bindManyToOne(Element node, ManyToOne manyToOne, String path,
16311622

16321623
manyToOne.setReferencedEntityName( getEntityName( node, mappings ) );
16331624

1634-
String embed = node.attributeValue( "embed-xml" );
1635-
// sometimes embed is set to the default value when not specified in the mapping,
1636-
// so can't seem to determine if an attribute was explicitly set;
1637-
// log a warning if embed has a value different from the default.
1638-
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
1639-
LOG.embedXmlAttributesNoLongerSupported();
1640-
}
1641-
manyToOne.setEmbedded( embed == null || "true".equals( embed ) );
1642-
16431625
String notFound = node.attributeValue( "not-found" );
16441626
manyToOne.setIgnoreNotFound( "ignore".equals( notFound ) );
16451627

@@ -1714,15 +1696,6 @@ public static void bindOneToOne(Element node, OneToOne oneToOne, String path, bo
17141696
initOuterJoinFetchSetting( node, oneToOne );
17151697
initLaziness( node, oneToOne, mappings, true );
17161698

1717-
String embed = node.attributeValue( "embed-xml" );
1718-
// sometimes embed is set to the default value when not specified in the mapping,
1719-
// so can't seem to determine if an attribute was explicitly set;
1720-
// log a warning if embed has a value different from the default.
1721-
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
1722-
LOG.embedXmlAttributesNoLongerSupported();
1723-
}
1724-
oneToOne.setEmbedded( "true".equals( embed ) );
1725-
17261699
Attribute fkNode = node.attribute( "foreign-key" );
17271700
if ( fkNode != null ) oneToOne.setForeignKeyName( fkNode.getValue() );
17281701

@@ -1748,15 +1721,6 @@ public static void bindOneToMany(Element node, OneToMany oneToMany, Mappings map
17481721

17491722
oneToMany.setReferencedEntityName( getEntityName( node, mappings ) );
17501723

1751-
String embed = node.attributeValue( "embed-xml" );
1752-
// sometimes embed is set to the default value when not specified in the mapping,
1753-
// so can't seem to determine if an attribute was explicitly set;
1754-
// log a warning if embed has a value different from the default.
1755-
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
1756-
LOG.embedXmlAttributesNoLongerSupported();
1757-
}
1758-
oneToMany.setEmbedded( embed == null || "true".equals( embed ) );
1759-
17601724
String notFound = node.attributeValue( "not-found" );
17611725
oneToMany.setIgnoreNotFound( "ignore".equals( notFound ) );
17621726

hibernate-core/src/main/java/org/hibernate/cfg/OneToOneSecondPass.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ else if ( otherSideProperty.getValue() instanceof ManyToOne ) {
183183
//FIXME use ignore not found here
184184
manyToOne.setIgnoreNotFound( ignoreNotFound );
185185
manyToOne.setCascadeDeleteEnabled( value.isCascadeDeleteEnabled() );
186-
manyToOne.setEmbedded( value.isEmbedded() );
187186
manyToOne.setFetchMode( value.getFetchMode() );
188187
manyToOne.setLazy( value.isLazy() );
189188
manyToOne.setReferencedEntityName( value.getReferencedEntityName() );

hibernate-core/src/main/java/org/hibernate/internal/CoreMessageLogger.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,13 +1601,13 @@ void cannotResolveNonNullableTransientDependencies(String transientEntityString,
16011601
)
16021602
void aliasSpecificLockingWithFollowOnLocking(LockMode lockMode);
16031603

1604-
@LogMessage(level = WARN)
1605-
@Message(
1606-
value = "embed-xml attributes were intended to be used for DOM4J entity mode. Since that entity mode has been " +
1607-
"removed, embed-xml attributes are no longer supported and should be removed from mappings.",
1608-
id = 446
1609-
)
1610-
void embedXmlAttributesNoLongerSupported();
1604+
// @LogMessage(level = WARN)
1605+
// @Message(
1606+
// value = "embed-xml attributes were intended to be used for DOM4J entity mode. Since that entity mode has been " +
1607+
// "removed, embed-xml attributes are no longer supported and should be removed from mappings.",
1608+
// id = 446
1609+
// )
1610+
// void embedXmlAttributesNoLongerSupported();
16111611

16121612
@LogMessage(level = WARN)
16131613
@Message(

hibernate-core/src/main/java/org/hibernate/mapping/Collection.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public abstract class Collection implements Fetchable, Value, Filterable {
7777
private boolean orphanDelete;
7878
private int batchSize = -1;
7979
private FetchMode fetchMode;
80-
private boolean embedded = true;
8180
private boolean optimisticLocked = true;
8281
private Class collectionPersisterClass;
8382
private String typeName;
@@ -612,24 +611,6 @@ public void setElementNodeName(String elementNodeName) {
612611
this.elementNodeName = elementNodeName;
613612
}
614613

615-
/**
616-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
617-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
618-
*/
619-
@Deprecated
620-
public boolean isEmbedded() {
621-
return embedded;
622-
}
623-
624-
/**
625-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
626-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
627-
*/
628-
@Deprecated
629-
public void setEmbedded(boolean embedded) {
630-
this.embedded = embedded;
631-
}
632-
633614
public boolean isSubselectLoadable() {
634615
return subselectLoadable;
635616
}

hibernate-core/src/main/java/org/hibernate/mapping/OneToMany.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public class OneToMany implements Value {
4242

4343
private String referencedEntityName;
4444
private PersistentClass associatedClass;
45-
private boolean embedded;
4645
private boolean ignoreNotFound;
4746

4847
private EntityType getEntityType() {
@@ -150,24 +149,6 @@ public boolean[] getColumnUpdateability() {
150149
throw new UnsupportedOperationException();
151150
}
152151

153-
/**
154-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
155-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
156-
*/
157-
@Deprecated
158-
public boolean isEmbedded() {
159-
return embedded;
160-
}
161-
162-
/**
163-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
164-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
165-
*/
166-
@Deprecated
167-
public void setEmbedded(boolean embedded) {
168-
this.embedded = embedded;
169-
}
170-
171152
public boolean isIgnoreNotFound() {
172153
return ignoreNotFound;
173154
}

hibernate-core/src/main/java/org/hibernate/mapping/ToOne.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public abstract class ToOne extends SimpleValue implements Fetchable {
3838
private FetchMode fetchMode;
3939
protected String referencedPropertyName;
4040
private String referencedEntityName;
41-
private boolean embedded;
4241
private boolean lazy = true;
4342
protected boolean unwrapProxy;
4443

@@ -89,24 +88,6 @@ public Object accept(ValueVisitor visitor) {
8988
return visitor.accept(this);
9089
}
9190

92-
/**
93-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
94-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
95-
*/
96-
@Deprecated
97-
public boolean isEmbedded() {
98-
return embedded;
99-
}
100-
101-
/**
102-
* @deprecated To be removed in 5. Removed as part of removing the notion of DOM entity-mode.
103-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
104-
*/
105-
@Deprecated
106-
public void setEmbedded(boolean embedded) {
107-
this.embedded = embedded;
108-
}
109-
11091
public boolean isValid(Mapping mapping) throws MappingException {
11192
if (referencedEntityName==null) {
11293
throw new MappingException("association must specify the referenced entity");

hibernate-core/src/main/java/org/hibernate/type/AbstractStandardBasicType.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,6 @@ public final boolean isAnyType() {
177177
return false;
178178
}
179179

180-
public final boolean isXMLElement() {
181-
return false;
182-
}
183-
184180
@SuppressWarnings({ "unchecked" })
185181
public final boolean isSame(Object x, Object y) {
186182
return isEqual( x, y );

hibernate-core/src/main/java/org/hibernate/type/AbstractType.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ public boolean isEntityType() {
6262
return false;
6363
}
6464

65-
public boolean isXMLElement() {
66-
return false;
67-
}
68-
6965
public int compare(Object x, Object y) {
7066
return ( (Comparable) x ).compareTo(y);
7167
}
@@ -145,16 +141,6 @@ public int getHashCode(Object x, SessionFactoryImplementor factory) {
145141
return getHashCode(x );
146142
}
147143

148-
protected static void replaceNode(Node container, Element value) {
149-
if ( container!=value ) { //not really necessary, I guess...
150-
Element parent = container.getParent();
151-
container.detach();
152-
value.setName( container.getName() );
153-
value.detach();
154-
parent.add(value);
155-
}
156-
}
157-
158144
public Type getSemiResolvedType(SessionFactoryImplementor factory) {
159145
return this;
160146
}

hibernate-core/src/main/java/org/hibernate/type/AnyType.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,6 @@ public String getLHSPropertyName() {
374374
public boolean isAlwaysDirtyChecked() {
375375
return false;
376376
}
377-
378-
public boolean isEmbeddedInXML() {
379-
return false;
380-
}
381377

382378
public boolean[] toColumnNullness(Object value, Mapping mapping) {
383379
boolean[] result = new boolean[ getColumnSpan(mapping) ];

hibernate-core/src/main/java/org/hibernate/type/ArrayType.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ public class ArrayType extends CollectionType {
4747
private final Class elementClass;
4848
private final Class arrayClass;
4949

50-
/**
51-
* @deprecated Use {@link #ArrayType(TypeFactory.TypeScope, String, String, Class )} instead.
52-
* See Jira issue: <a href="https://hibernate.onjira.com/browse/HHH-7771">HHH-7771</a>
53-
*/
54-
@Deprecated
55-
public ArrayType(TypeFactory.TypeScope typeScope, String role, String propertyRef, Class elementClass, boolean isEmbeddedInXML) {
56-
super( typeScope, role, propertyRef, isEmbeddedInXML );
57-
this.elementClass = elementClass;
58-
arrayClass = Array.newInstance(elementClass, 0).getClass();
59-
}
60-
6150
public Class getElementClass() {
6251
return elementClass;
6352
}

0 commit comments

Comments
 (0)