Skip to content

HHH-19324 - Switch tests using hbm.xml to use mapping.xml #9956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

sebersole
Copy link
Member

@sebersole sebersole commented Apr 3, 2025

HHH-19324 - Switch tests using hbm.xml to use mapping.xml
HHH-19310 - Simplified declaration of type for basic mappings in XML

This is preliminary work which is converting tests using hbm.xml mappings to instead use mapping.xml and addressing gaps. Ultimately this PR will get merged into main (7.x).

Once all tests have been converted and gaps addressed (which just might mean Jira created for thre moment), we can start actually removing the code for applying hbm.xml - though that will be 8.x specific


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-19324

@sebersole sebersole changed the title HHH-17503 - Remove support for hbm.xml mappings HHH-19324 - Switch tests using hbm.xml to use mapping.xml Apr 7, 2025
HHH-19310 - Simplified declaration of type for basic mappings in XML

# Conflicts:
#	hibernate-core/src/main/java/org/hibernate/boot/model/process/spi/MetadataBuildingProcess.java
#	hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/ManagedTypeProcessor.java
#	hibernate-core/src/main/java/org/hibernate/boot/models/xml/spi/XmlDocumentContext.java
#	hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/xml/column/transform/ModelTests.java
#	hibernate-core/src/test/java/org/hibernate/orm/test/boot/models/xml/dynamic/DynamicModelTests.java
@Test
public void testFullQueryReference(SessionFactoryScope scope) {
scope.inTransaction(
session -> session.createQuery( "from DynamicCompositeIdBasic e where e.id.key1 = 1" ).list()

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
@Test
public void testEmbeddedQueryReference(SessionFactoryScope scope) {
scope.inTransaction(
session -> session.createQuery( "from DynamicCompositeIdBasic e where e.key1 = 1" ).list()

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
public void testFullQueryReference(SessionFactoryScope scope) {
scope.inTransaction(
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
scope.inTransaction(
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.id.key1 = 1" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.id.key1 = 1" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.id.key2.name = 'abc'" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
public void testEmbeddedQueryReference(SessionFactoryScope scope) {
scope.inTransaction(
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
scope.inTransaction(
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.key1 = 1" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
(session) -> {
session.createQuery( "select e from DynamicCompositeIdManyToOne e" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.key1 = 1" ).list();
session.createQuery( "select e from DynamicCompositeIdManyToOne e where e.key2.name = 'abc'" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
@Test
public void testUsage(SessionFactoryScope factoryScope) {
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleDynamicEntity" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
public void testUsage(SessionFactoryScope factoryScope) {
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleDynamicEntity" ).list();
session.createQuery( "select e from SimpleDynamicEntity e" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleDynamicEntity" ).list();
session.createQuery( "select e from SimpleDynamicEntity e" ).list();
session.createQuery( "select e from SimpleDynamicEntity e where e.name = 'abc'" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
@Test
void testUsage(SessionFactoryScope factoryScope) {
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleEntity" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
void testUsage(SessionFactoryScope factoryScope) {
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleEntity" ).list();
session.createQuery( "select e from SimpleEntity e" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
factoryScope.inTransaction( (session) -> {
session.createQuery( "from SimpleEntity" ).list();
session.createQuery( "select e from SimpleEntity e" ).list();
session.createQuery( "select e from SimpleEntity e where e.name = 'abc'" ).list();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant