mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 14:30:16 +00:00
HHH-7860 : Log a warning when embed-xml attribute is used in mappings
This commit is contained in:
parent
1782a9dc84
commit
c6ef23a51c
@ -1403,6 +1403,12 @@ public static void bindCollection(Element node, Collection collection, String cl
|
||||
if ( nodeName == null ) nodeName = node.attributeValue( "name" );
|
||||
collection.setNodeName( nodeName );
|
||||
String embed = node.attributeValue( "embed-xml" );
|
||||
// sometimes embed is set to the default value when not specified in the mapping,
|
||||
// so can't seem to determine if an attribute was explicitly set;
|
||||
// log a warning if embed has a value different from the default.
|
||||
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
|
||||
LOG.embedXmlAttributesNoLongerSupported();
|
||||
}
|
||||
collection.setEmbedded( embed==null || "true".equals(embed) );
|
||||
|
||||
|
||||
@ -1626,6 +1632,12 @@ public static void bindManyToOne(Element node, ManyToOne manyToOne, String path,
|
||||
manyToOne.setReferencedEntityName( getEntityName( node, mappings ) );
|
||||
|
||||
String embed = node.attributeValue( "embed-xml" );
|
||||
// sometimes embed is set to the default value when not specified in the mapping,
|
||||
// so can't seem to determine if an attribute was explicitly set;
|
||||
// log a warning if embed has a value different from the default.
|
||||
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
|
||||
LOG.embedXmlAttributesNoLongerSupported();
|
||||
}
|
||||
manyToOne.setEmbedded( embed == null || "true".equals( embed ) );
|
||||
|
||||
String notFound = node.attributeValue( "not-found" );
|
||||
@ -1701,7 +1713,14 @@ public static void bindOneToOne(Element node, OneToOne oneToOne, String path, bo
|
||||
initOuterJoinFetchSetting( node, oneToOne );
|
||||
initLaziness( node, oneToOne, mappings, true );
|
||||
|
||||
oneToOne.setEmbedded( "true".equals( node.attributeValue( "embed-xml" ) ) );
|
||||
String embed = node.attributeValue( "embed-xml" );
|
||||
// sometimes embed is set to the default value when not specified in the mapping,
|
||||
// so can't seem to determine if an attribute was explicitly set;
|
||||
// log a warning if embed has a value different from the default.
|
||||
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
|
||||
LOG.embedXmlAttributesNoLongerSupported();
|
||||
}
|
||||
oneToOne.setEmbedded( "true".equals( embed ) );
|
||||
|
||||
Attribute fkNode = node.attribute( "foreign-key" );
|
||||
if ( fkNode != null ) oneToOne.setForeignKeyName( fkNode.getValue() );
|
||||
@ -1729,6 +1748,12 @@ public static void bindOneToMany(Element node, OneToMany oneToMany, Mappings map
|
||||
oneToMany.setReferencedEntityName( getEntityName( node, mappings ) );
|
||||
|
||||
String embed = node.attributeValue( "embed-xml" );
|
||||
// sometimes embed is set to the default value when not specified in the mapping,
|
||||
// so can't seem to determine if an attribute was explicitly set;
|
||||
// log a warning if embed has a value different from the default.
|
||||
if ( !StringHelper.isEmpty( embed ) && !"true".equals( embed ) ) {
|
||||
LOG.embedXmlAttributesNoLongerSupported();
|
||||
}
|
||||
oneToMany.setEmbedded( embed == null || "true".equals( embed ) );
|
||||
|
||||
String notFound = node.attributeValue( "not-found" );
|
||||
|
@ -1601,4 +1601,12 @@ void cannotResolveNonNullableTransientDependencies(String transientEntityString,
|
||||
)
|
||||
void aliasSpecificLockingWithFollowOnLocking(LockMode lockMode);
|
||||
|
||||
@LogMessage(level = WARN)
|
||||
@Message(
|
||||
value = "embed-xml attributes were intended to be used for DOM4J entity mode. Since that entity mode has been " +
|
||||
"removed, embed-xml attributes are no longer supported and should be removed from mappings.",
|
||||
id = 446
|
||||
)
|
||||
void embedXmlAttributesNoLongerSupported();
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user