re-enable tests
This commit is contained in:
parent
2589671fa1
commit
12fb58f6b9
|
@ -2896,14 +2896,19 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
|
||||||
@Override
|
@Override
|
||||||
public SqmExpression<?> visitJpaNonStandardFunction(HqlParser.JpaNonStandardFunctionContext ctx) {
|
public SqmExpression<?> visitJpaNonStandardFunction(HqlParser.JpaNonStandardFunctionContext ctx) {
|
||||||
final String functionName = ctx.jpaNonStandardFunctionName().STRING_LITERAL().getText().toLowerCase();
|
final String functionName = ctx.jpaNonStandardFunctionName().STRING_LITERAL().getText().toLowerCase();
|
||||||
List<SqmTypedNode<?>> functionArguments =
|
//noinspection unchecked
|
||||||
ctx.nonStandardFunctionArguments() == null ? emptyList() :
|
final List<SqmTypedNode<?>> functionArguments = ctx.nonStandardFunctionArguments() == null
|
||||||
(List<SqmTypedNode<?>>) ctx.nonStandardFunctionArguments().accept( this );
|
? emptyList()
|
||||||
|
: (List<SqmTypedNode<?>>) ctx.nonStandardFunctionArguments().accept( this );
|
||||||
|
|
||||||
SqmFunctionDescriptor functionTemplate = getFunctionDescriptor( functionName );
|
SqmFunctionDescriptor functionTemplate = getFunctionDescriptor( functionName );
|
||||||
if (functionTemplate == null) {
|
if (functionTemplate == null) {
|
||||||
functionTemplate = new NamedSqmFunctionDescriptor( functionName, true, null,
|
functionTemplate = new NamedSqmFunctionDescriptor(
|
||||||
StandardFunctionReturnTypeResolvers.invariant( StandardBasicTypes.OBJECT_TYPE ) );
|
functionName,
|
||||||
|
true,
|
||||||
|
null,
|
||||||
|
StandardFunctionReturnTypeResolvers.invariant( StandardBasicTypes.OBJECT_TYPE )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return functionTemplate.generateSqmExpression(
|
return functionTemplate.generateSqmExpression(
|
||||||
functionArguments,
|
functionArguments,
|
||||||
|
@ -2918,21 +2923,29 @@ public class SemanticQueryBuilder<R> extends HqlParserBaseVisitor<Object> implem
|
||||||
if ( creationOptions.useStrictJpaCompliance() ) {
|
if ( creationOptions.useStrictJpaCompliance() ) {
|
||||||
throw new StrictJpaComplianceViolation(
|
throw new StrictJpaComplianceViolation(
|
||||||
"Encountered non-compliant non-standard function call [" +
|
"Encountered non-compliant non-standard function call [" +
|
||||||
ctx.nonStandardFunctionName() + "], but strict JPQL compliance was requested; use JPA's FUNCTION(functionName[,...]) syntax name instead",
|
ctx.nonStandardFunctionName() + "], but strict JPA " +
|
||||||
|
"compliance was requested; use JPA's FUNCTION(functionName[,...]) " +
|
||||||
|
"syntax name instead",
|
||||||
StrictJpaComplianceViolation.Type.FUNCTION_CALL
|
StrictJpaComplianceViolation.Type.FUNCTION_CALL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
final String functionName = ctx.nonStandardFunctionName().getText().toLowerCase();
|
final String functionName = ctx.nonStandardFunctionName().getText().toLowerCase();
|
||||||
List<SqmTypedNode<?>> functionArguments =
|
//noinspection unchecked
|
||||||
ctx.nonStandardFunctionArguments() == null ? emptyList() :
|
final List<SqmTypedNode<?>> functionArguments = ctx.nonStandardFunctionArguments() == null
|
||||||
(List<SqmTypedNode<?>>) ctx.nonStandardFunctionArguments().accept( this );
|
? emptyList()
|
||||||
|
: (List<SqmTypedNode<?>>) ctx.nonStandardFunctionArguments().accept( this );
|
||||||
|
|
||||||
SqmFunctionDescriptor functionTemplate = getFunctionDescriptor(functionName);
|
SqmFunctionDescriptor functionTemplate = getFunctionDescriptor( functionName );
|
||||||
if (functionTemplate == null) {
|
if ( functionTemplate == null ) {
|
||||||
functionTemplate = new NamedSqmFunctionDescriptor( functionName, true, null,
|
functionTemplate = new NamedSqmFunctionDescriptor(
|
||||||
StandardFunctionReturnTypeResolvers.invariant( StandardBasicTypes.OBJECT_TYPE ) );
|
functionName,
|
||||||
|
true,
|
||||||
|
null,
|
||||||
|
StandardFunctionReturnTypeResolvers.invariant( StandardBasicTypes.OBJECT_TYPE )
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return functionTemplate.generateSqmExpression(
|
return functionTemplate.generateSqmExpression(
|
||||||
functionArguments,
|
functionArguments,
|
||||||
null,
|
null,
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
/*
|
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
|
||||||
*
|
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
|
||||||
*/
|
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.NaturalId;
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
|
||||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
|
||||||
|
|
||||||
import org.hibernate.testing.RequiresDialect;
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
|
||||||
import org.hibernate.testing.util.ExceptionUtil;
|
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
|
||||||
import static org.junit.Assert.assertNotNull;
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Vlad Mihalcea
|
|
||||||
*/
|
|
||||||
@RequiresDialect(H2Dialect.class)
|
|
||||||
@TestForIssue( jiraKey = "HHH-12589" )
|
|
||||||
public class SqlFunctionMissingTest extends BaseEntityManagerFunctionalTestCase {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected Class<?>[] getAnnotatedClasses() {
|
|
||||||
return new Class<?>[] {
|
|
||||||
Employee.class,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
final Employee employee = new Employee();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void afterEntityManagerFactoryBuilt() {
|
|
||||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
|
||||||
employee.id = 1L;
|
|
||||||
employee.username = "user@acme.com";
|
|
||||||
|
|
||||||
entityManager.persist( employee );
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test() {
|
|
||||||
try {
|
|
||||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
|
||||||
Number result = (Number) entityManager.createQuery(
|
|
||||||
"select INSTR(e.username,'@') " +
|
|
||||||
"from Employee e " +
|
|
||||||
"where " +
|
|
||||||
" e.id = :employeeId")
|
|
||||||
.setParameter( "employeeId", employee.id )
|
|
||||||
.getSingleResult();
|
|
||||||
|
|
||||||
fail("Should throw exception!");
|
|
||||||
} );
|
|
||||||
}
|
|
||||||
catch (Exception expected) {
|
|
||||||
assertTrue( ExceptionUtil.rootCause( expected ).getMessage().contains( "No data type for node: org.hibernate.hql.internal.ast.tree.MethodNod" ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Entity(name = "Employee")
|
|
||||||
public static class Employee {
|
|
||||||
|
|
||||||
@Id
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@NaturalId
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
private String password;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,4 +1,10 @@
|
||||||
package org.hibernate.boot.model.source.internal.hbm;
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
*/
|
||||||
|
package org.hibernate.orm.test.bootstrap.binding.mixed;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
package org.hibernate.boot.model.source.internal.hbm;
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
*/
|
||||||
|
package org.hibernate.orm.test.bootstrap.binding.mixed;
|
||||||
|
|
||||||
public class HBMEntity {
|
public class HBMEntity {
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
package org.hibernate.boot.model.source.internal.hbm;
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
*/
|
||||||
|
package org.hibernate.orm.test.bootstrap.binding.mixed;
|
||||||
|
|
||||||
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
import org.hibernate.testing.junit4.BaseNonConfigCoreFunctionalTestCase;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
@ -27,7 +33,7 @@ public class HBMManyToOneAnnotationMissingPrimaryKeyTest extends BaseNonConfigCo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBaseForMappings() {
|
protected String getBaseForMappings() {
|
||||||
return "/org/hibernate/boot/model/source/internal/hbm/";
|
return "/org/hibernate/orm/test/bootstrap/binding/mixed/";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.model.source.internal.hbm;
|
package org.hibernate.orm.test.bootstrap.binding.mixed;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class XMLMappingDisabledTest extends BaseNonConfigCoreFunctionalTestCase
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getBaseForMappings() {
|
protected String getBaseForMappings() {
|
||||||
return "/org/hibernate/boot/model/source/internal/hbm/";
|
return "/org/hibernate/orm/test/bootstrap/binding/mixed/";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
|
@ -0,0 +1,11 @@
|
||||||
|
/*
|
||||||
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
*
|
||||||
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for verifying mixed use of HBM and annotations
|
||||||
|
*/
|
||||||
|
package org.hibernate.orm.test.bootstrap.binding.mixed;
|
|
@ -1,10 +1,13 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.model.naming;
|
package org.hibernate.orm.test.bootstrap.binding.naming;
|
||||||
|
|
||||||
|
import org.hibernate.boot.model.naming.ImplicitIndexColumnNameSource;
|
||||||
|
import org.hibernate.boot.model.naming.ImplicitNameSource;
|
||||||
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
|
@ -1,14 +1,17 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.model.naming;
|
package org.hibernate.orm.test.bootstrap.binding.naming;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import org.hibernate.boot.model.naming.Identifier;
|
||||||
|
import org.hibernate.boot.model.naming.NamingHelper;
|
||||||
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.hibernate.testing.junit4.BaseUnitTestCase;
|
import org.hibernate.testing.junit4.BaseUnitTestCase;
|
||||||
import org.hibernate.testing.util.ReflectionUtil;
|
import org.hibernate.testing.util.ReflectionUtil;
|
|
@ -1,10 +1,10 @@
|
||||||
/*
|
/*
|
||||||
* Hibernate, Relational Persistence for Idiomatic Java
|
* Hibernate, Relational Persistence for Idiomatic Java
|
||||||
*
|
*
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.registry.classloading.internal;
|
package org.hibernate.orm.test.bootstrap.registry.classloading;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -12,6 +12,9 @@ import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl;
|
||||||
|
import org.hibernate.boot.registry.classloading.internal.TcclLookupPrecedence;
|
||||||
|
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.registry.classloading.internal;
|
package org.hibernate.orm.test.bootstrap.registry.classloading;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.registry.classloading.internal;
|
package org.hibernate.orm.test.bootstrap.registry.classloading;
|
||||||
|
|
||||||
import org.hibernate.service.Service;
|
import org.hibernate.service.Service;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.registry.classloading.internal;
|
package org.hibernate.orm.test.bootstrap.registry.classloading;
|
||||||
|
|
||||||
public class MyServiceImpl implements MyService {
|
public class MyServiceImpl implements MyService {
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingMetadata;
|
import org.hibernate.boot.spi.AbstractDelegatingMetadata;
|
||||||
import org.hibernate.boot.spi.MetadataImplementor;
|
import org.hibernate.boot.spi.MetadataImplementor;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingMetadataBuilderImplementor;
|
import org.hibernate.boot.spi.AbstractDelegatingMetadataBuilderImplementor;
|
||||||
import org.hibernate.boot.spi.BootstrapContext;
|
import org.hibernate.boot.spi.BootstrapContext;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingMetadataBuildingOptions;
|
import org.hibernate.boot.spi.AbstractDelegatingMetadataBuildingOptions;
|
||||||
import org.hibernate.boot.spi.MetadataBuildingOptions;
|
import org.hibernate.boot.spi.MetadataBuildingOptions;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.SessionFactoryBuilder;
|
import org.hibernate.boot.SessionFactoryBuilder;
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryBuilder;
|
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryBuilder;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryBuilderImplementor;
|
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryBuilderImplementor;
|
||||||
import org.hibernate.boot.spi.SessionFactoryBuilderImplementor;
|
import org.hibernate.boot.spi.SessionFactoryBuilderImplementor;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.delegation;
|
package org.hibernate.orm.test.bootstrap.spi.delegation;
|
||||||
|
|
||||||
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryOptions;
|
import org.hibernate.boot.spi.AbstractDelegatingSessionFactoryOptions;
|
||||||
import org.hibernate.boot.spi.SessionFactoryOptions;
|
import org.hibernate.boot.spi.SessionFactoryOptions;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
@ -61,15 +61,15 @@ public abstract class AbstractSqlFunctionMetadataBuilderContributorTest extends
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
doInJPA( this::entityManagerFactory, entityManager -> {
|
doInJPA( this::entityManagerFactory, entityManager -> {
|
||||||
String result = (String) entityManager.createQuery(
|
int result = entityManager.createQuery(
|
||||||
"select INSTR(e.username,'@acme.com') " +
|
"select INSTR(e.username,'@acme.com') " +
|
||||||
"from Employee e " +
|
"from Employee e " +
|
||||||
"where " +
|
"where " +
|
||||||
" e.id = :employeeId")
|
" e.id = :employeeId", Integer.class )
|
||||||
.setParameter( "employeeId", employee.id )
|
.setParameter( "employeeId", employee.id )
|
||||||
.getSingleResult();
|
.getSingleResult();
|
||||||
|
|
||||||
assertEquals( "5", result );
|
assertEquals( 5, result );
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -1,4 +1,4 @@
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import org.hibernate.boot.MetadataBuilder;
|
import org.hibernate.boot.MetadataBuilder;
|
||||||
import org.hibernate.boot.spi.MetadataBuilderContributor;
|
import org.hibernate.boot.spi.MetadataBuilderContributor;
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
|
|
|
@ -4,20 +4,12 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.persistence.Entity;
|
|
||||||
import javax.persistence.Id;
|
|
||||||
|
|
||||||
import org.hibernate.annotations.NaturalId;
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl;
|
|
||||||
import org.hibernate.jpa.test.BaseEntityManagerFunctionalTestCase;
|
|
||||||
|
|
||||||
import org.hibernate.testing.RequiresDialect;
|
import org.hibernate.testing.RequiresDialect;
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
import static org.hibernate.testing.transaction.TransactionUtil.doInJPA;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
|
@ -4,11 +4,10 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
|
|
||||||
import org.hibernate.testing.FailureExpected;
|
|
||||||
import org.hibernate.testing.RequiresDialect;
|
import org.hibernate.testing.RequiresDialect;
|
||||||
import org.hibernate.testing.TestForIssue;
|
import org.hibernate.testing.TestForIssue;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
|
||||||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
|
||||||
*/
|
*/
|
||||||
package org.hibernate.boot.spi.metadatabuildercontributor;
|
package org.hibernate.orm.test.bootstrap.spi.metadatabuildercontributor;
|
||||||
|
|
||||||
import org.hibernate.dialect.H2Dialect;
|
import org.hibernate.dialect.H2Dialect;
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
org.hibernate.boot.registry.classloading.internal.MyServiceImpl
|
|
|
@ -0,0 +1 @@
|
||||||
|
org.hibernate.orm.test.bootstrap.registry.classloading.MyServiceImpl
|
|
@ -1,9 +1,15 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
~ Hibernate, Relational Persistence for Idiomatic Java
|
||||||
|
~
|
||||||
|
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
|
||||||
|
~ See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
|
||||||
|
-->
|
||||||
<!DOCTYPE hibernate-mapping PUBLIC
|
<!DOCTYPE hibernate-mapping PUBLIC
|
||||||
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
||||||
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
|
||||||
|
|
||||||
<hibernate-mapping package="org.hibernate.boot.model.source.internal.hbm">
|
<hibernate-mapping package="org.hibernate.orm.test.bootstrap.binding.mixed">
|
||||||
<class name="HBMEntity" table="hbmentity" >
|
<class name="HBMEntity" table="hbmentity" >
|
||||||
<id name="id" unsaved-value="0">
|
<id name="id" unsaved-value="0">
|
||||||
<generator class="sequence">
|
<generator class="sequence">
|
Loading…
Reference in New Issue