Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1fcc901
HHH-18689 Test FULL query cache sometimes incomplete
kkuegler Oct 3, 2024
3ba7a96
HHH-18689 Maintain proxy targets when converting cache entries
beikov Oct 7, 2024
758d34f
HHH-18583 Add test for issue
mbellade Sep 10, 2024
65684aa
HHH-18583 Include identifier cols in persister's shared column names
mbellade Sep 10, 2024
5f8e275
HHH-18709 Add test for issue
mbellade Oct 29, 2024
e8af2fd
HHH-18709 Use path to infer criteria value-bind parameter type on `set`
mbellade Nov 29, 2024
ae03d66
HHH-18872 Test reproducing the issue
gtoison Nov 22, 2024
730d8d9
HHH-18872 Rename and cleanup test
mbellade Nov 22, 2024
c14913e
HHH-18872 Resolve concrete entity name when initializing lazy to-ones
mbellade Nov 22, 2024
f784789
Require approval for Quarkus and TCK Jenkins pipelines as well
beikov Nov 29, 2024
6963e80
HHH-18274 Test similar to org.hibernate.orm.test.query.hql.instantia…
cigaly Jun 14, 2024
26e6e90
HHH-18274 Properly resolving Java type in binary and unary expressions
cigaly Jun 14, 2024
4f026a4
HHH-18360 Fix for Informix function str() error
VladoKuruc Jul 9, 2024
e512405
HHH-18361 Fix for Informix current_time error
VladoKuruc Jul 9, 2024
e39774e
HHH-18362 Fix for Informix function substring() error
VladoKuruc Jul 9, 2024
263a046
HHH-18363 Fix for Informix component nullness check error
VladoKuruc Jul 9, 2024
a7ad1c5
HHH-18364 Fix for Informix function locate() error
VladoKuruc Jul 10, 2024
efdc1e7
HHH-18365 Fix for Informix function bit_length() error
VladoKuruc Jul 10, 2024
e5bc558
HHH-18367 Fix for Informix sum on case expression error
VladoKuruc Jul 10, 2024
a13c79f
HHH-18369 Support Informix matches() function
VladoKuruc Jul 10, 2024
9e2aa7e
HHH-18168 Skip test for older Informix
VladoKuruc Nov 29, 2024
4299df8
Informix tests fixes
VladoKuruc Jul 9, 2024
f7b3a68
HHH-18906 Allow unsupported enhancement strategy in hibernate testing
mbellade Dec 3, 2024
c289d95
HHH-18384 Preserving order of @Id annotated elements while adding to …
cigaly Nov 17, 2024
5bbc5ec
HHH-18384 Inheritance hierarchy must be followed
cigaly Nov 17, 2024
aa7f5a5
HHH-18384 Changes after PR comments
cigaly Nov 21, 2024
78719e4
HHH-18850 fix count queries with 'distinct' and 'order by'
gavinking Nov 15, 2024
c7ea14a
HHH-18903 HHH-18904 Add test for issue
mbellade Dec 4, 2024
dee4ab6
HHH-18903 HHH-18904 Improve accessor methods check during enhancement
mbellade Dec 4, 2024
ab49616
HHH-18868 Adapted test case from https://hibernate.atlassian.net/brow…
cigaly Dec 1, 2024
d5b00aa
HHH-18868 ID and version properties are handled separately, do not pr…
cigaly Dec 1, 2024
c7e432b
HHH-18868 Renamed test classes
cigaly Dec 5, 2024
655c87a
HHH-18868 Simplified ID property check
cigaly Dec 5, 2024
b624d3a
HHH-18868 Cleanup tests and mapper-supers identifier mapper check
mbellade Dec 11, 2024
ff8288c
HHH-13377 Add test for issue
dreab8 Dec 3, 2024
6aca01a
HHH-13377 Lazy loaded properties of bytecode enhanced entity are left…
dreab8 Dec 3, 2024
2e666ac
HHH-17838 Add test for issue
dreab8 Oct 21, 2024
5874fd6
HHH-17838 @OneToOne relationship + @Embeddable keys + FetchType.LAZY …
dreab8 Oct 22, 2024
9afd83b
HHH-13790 Temporary session not being closed
flexo0 Dec 6, 2024
22958d8
HHH-17612 Add test for issue
mbellade Sep 30, 2024
dd8ef39
HHH-17612 Prevent logging injection error for envers static metamodel
mbellade Dec 9, 2024
031e422
HHH-18949 fix underscores within uppercase names
gavinking Dec 16, 2024
36bf344
HHH-13815 Add test for issue
dreab8 Dec 13, 2024
cf8331e
HHH-13815 TransientObjectException after merging a bidirectional one-…
dreab8 Dec 13, 2024
f477985
HHH-18932 Use target table columns for SQM joins, except for join tab…
beikov Dec 12, 2024
6aedc19
HHH-18629 Fix inconsistent column alias generated while result class …
beikov Nov 21, 2024
63a4a8d
HHH-14725 Fix reset handling on BlobProxy
Naros Dec 19, 2021
8ba773c
HHH-14725 Adjust test to use byte array, update Javadoc
Naros Dec 19, 2021
c203aaa
HHH-14725 Fixed test
dreab8 Dec 11, 2024
21c8279
HHH-14725 Fix reset handling on BlobProxy
dreab8 Dec 11, 2024
700bc1b
HHH-14725 Fixed test
dreab8 Dec 17, 2024
466503f
don't generate "auxiliary" members for Jakarta Data static metamodel
gavinking Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/jpa-3.1-tck.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pipeline {
stages {
stage('Build') {
steps {
requireApprovalForPullRequest 'hibernate'
script {
docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') {
docker.image('openjdk:11-jdk').pull()
Expand Down
3 changes: 2 additions & 1 deletion ci/quarkus.Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@Library('hibernate-jenkins-pipeline-helpers@1.5') _
@Library('hibernate-jenkins-pipeline-helpers@1.13') _

// Avoid running the pipeline on branch indexing
if (currentBuild.getBuildCauses().toString().contains('BranchIndexingCause')) {
Expand Down Expand Up @@ -28,6 +28,7 @@ pipeline {
stages {
stage('Build') {
steps {
requireApprovalForPullRequest 'hibernate'
script {
dir('hibernate') {
checkout scm
Expand Down
5 changes: 4 additions & 1 deletion docker_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,11 @@ informix() {
}

informix_14_10() {
temp_dir=$(mktemp -d)
echo "ALLOW_NEWLINE 1" >$temp_dir/onconfig.mod
chmod 777 -R $temp_dir
$PRIVILEGED_CLI $CONTAINER_CLI rm -f informix || true
$PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -e LICENSE=accept -e GL_USEGLU=1 -d ${DB_IMAGE_INFORMIX_14_10:-icr.io/informix/informix-developer-database:14.10.FC9W1DE}
$PRIVILEGED_CLI $CONTAINER_CLI run --name informix --privileged -p 9088:9088 -v $temp_dir:/opt/ibm/config -e LICENSE=accept -e GL_USEGLU=1 -d ${DB_IMAGE_INFORMIX_14_10:-icr.io/informix/informix-developer-database:14.10.FC9W1DE}
echo "Starting Informix. This can take a few minutes"
# Give the container some time to start
OUTPUT=
Expand Down
2 changes: 1 addition & 1 deletion gradle/databases.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ ext {
'jdbc.driver': 'com.informix.jdbc.IfxDriver',
'jdbc.user' : 'informix',
'jdbc.pass' : 'in4mix',
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/dev:INFORMIXSERVER=informix;user=informix;password=in4mix;DELIMIDENT=Y;DB_LOCALE=en_US.utf8',
'jdbc.url' : 'jdbc:informix-sqli://' + dbHost + ':9088/dev:INFORMIXSERVER=informix;user=informix;password=in4mix;DBDATE=Y4MD-;DELIMIDENT=Y;DB_LOCALE=en_US.utf8',
'jdbc.datasource' : 'com.informix.jdbc.IfxDriver',
// 'jdbc.datasource' : 'com.informix.jdbcx.IfxDataSource',
'connection.init_sql' : ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@
import org.hibernate.query.sqm.mutation.internal.temptable.LocalTemporaryTableMutationStrategy;
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableInsertStrategy;
import org.hibernate.query.sqm.mutation.spi.SqmMultiTableMutationStrategy;
import org.hibernate.query.sqm.produce.function.StandardFunctionArgumentTypeResolvers;
import org.hibernate.query.sqm.sql.SqmTranslator;
import org.hibernate.query.sqm.sql.SqmTranslatorFactory;
import org.hibernate.query.sqm.sql.StandardSqmTranslatorFactory;
import org.hibernate.query.sqm.tree.select.SqmSelectStatement;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.sql.ast.SqlAstNodeRenderingMode;
import org.hibernate.sql.ast.SqlAstTranslator;
import org.hibernate.sql.ast.SqlAstTranslatorFactory;
import org.hibernate.sql.ast.spi.SqlAppender;
Expand All @@ -71,7 +73,10 @@
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
import org.hibernate.tool.schema.internal.StandardForeignKeyExporter;
import org.hibernate.tool.schema.spi.Exporter;
import org.hibernate.type.JavaObjectType;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcType;
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;
import org.hibernate.type.descriptor.sql.DdlType;
import org.hibernate.type.descriptor.sql.internal.CapacityDependentDdlType;
Expand All @@ -82,6 +87,7 @@
import jakarta.persistence.TemporalType;

import static org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtractor.extractUsingTemplate;
import static org.hibernate.query.sqm.produce.function.FunctionParameterType.STRING;
import static org.hibernate.type.SqlTypes.BIGINT;
import static org.hibernate.type.SqlTypes.BINARY;
import static org.hibernate.type.SqlTypes.FLOAT;
Expand Down Expand Up @@ -276,10 +282,10 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
super.initializeFunctionRegistry(functionContributions);

CommonFunctionFactory functionFactory = new CommonFunctionFactory(functionContributions);
functionFactory.aggregates( this, SqlAstNodeRenderingMode.NO_PLAIN_PARAMETER );
functionFactory.instr();
functionFactory.substr();
functionFactory.substring_substr();
//also natively supports ANSI-style substring()
functionFactory.substringFromFor();
functionFactory.trunc();
functionFactory.trim2();
functionFactory.space();
Expand All @@ -302,12 +308,30 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
functionFactory.monthsBetween();
functionFactory.stddev();
functionFactory.variance();
functionFactory.locate_positionSubstring();
functionFactory.bitLength_pattern( "length(?1)*8" );

if ( getVersion().isSameOrAfter( 12 ) ) {
functionFactory.locate_charindex();
}

//coalesce() and nullif() both supported since Informix 12

functionContributions.getFunctionRegistry().register( "least", new CaseLeastGreatestEmulation( true ) );
functionContributions.getFunctionRegistry().register( "greatest", new CaseLeastGreatestEmulation( false ) );
functionContributions.getFunctionRegistry().namedDescriptorBuilder( "matches" )
.setInvariantType( functionContributions.getTypeConfiguration()
.getBasicTypeRegistry()
.resolve( StandardBasicTypes.STRING )
)
.setExactArgumentCount( 2 )
.setArgumentTypeResolver(
StandardFunctionArgumentTypeResolvers.impliedOrInvariant(
functionContributions.getTypeConfiguration(),
STRING
)
)
.setArgumentListSignature( "(STRING string, STRING pattern)" )
.register();
if ( supportsWindowFunctions() ) {
functionFactory.windowFunctions();
}
Expand Down Expand Up @@ -672,6 +696,11 @@ public String currentDate() {
return "today";
}

@Override
public String currentTime() {
return currentTimestamp();
}

@Override
public String currentTimestamp() {
return "current";
Expand Down Expand Up @@ -816,6 +845,17 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
final JdbcTypeRegistry jdbcTypeRegistry = typeContributions.getTypeConfiguration().getJdbcTypeRegistry();
jdbcTypeRegistry.addDescriptor( Types.NCLOB, ClobJdbcType.DEFAULT );
typeContributions.contributeJdbcType( VarcharUUIDJdbcType.INSTANCE );
typeContributions.contributeJdbcType( ObjectNullAsBinaryTypeJdbcType.INSTANCE );

// Until we remove StandardBasicTypes, we have to keep this
typeContributions.contributeType(
new JavaObjectType(
ObjectNullAsBinaryTypeJdbcType.INSTANCE,
typeContributions.getTypeConfiguration()
.getJavaTypeRegistry()
.getDescriptor( Object.class )
)
);
Comment on lines +851 to +858

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TypeContributions.contributeType
should be avoided because it has been deprecated.
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,23 @@
);
}

@Test
@TestForIssue(jiraKey = "HHH-18369")
public void testMatches(SessionFactoryScope scope) {
scope.inTransaction(
(session) -> {
String country = (String) session.createQuery(
"select e.country " +
"from Event e " +
"where e.id = :id and matches(e.country, :country) = 'T'" )
Comment on lines +189 to +192

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
QueryProducerImplementor.createQuery
should be avoided because it has been deprecated.
.setParameter( "id", event.id )
.setParameter( "country", "R*" )
.getSingleResult();
assertEquals( "Romania", country );
}
);
}

private Calendar todayCalendar() {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public String getHqlString() {
public NamedSqmQueryMemento resolve(SessionFactoryImplementor factory) {
return new NamedHqlQueryMementoImpl(
getRegistrationName(),
null,
hqlString,
firstResult,
maxResults,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.hibernate.query.sql.internal.NamedNativeQueryMementoImpl;
import org.hibernate.query.sql.spi.NamedNativeQueryMemento;

import org.checkerframework.checker.nullness.qual.Nullable;

import static org.hibernate.internal.util.StringHelper.isNotEmpty;

/**
Expand Down Expand Up @@ -86,15 +88,16 @@ public String getResultSetMappingClassName() {

@Override
public NamedNativeQueryMemento resolve(SessionFactoryImplementor factory) {
Class<?> resultClass = isNotEmpty( resultSetMappingClassName )
? factory.getServiceRegistry().requireService( ClassLoaderService.class ).classForName( resultSetMappingClassName )
: null;
return new NamedNativeQueryMementoImpl(
getRegistrationName(),
resultClass,
sqlString,
sqlString,
resultSetMappingName,
isNotEmpty( resultSetMappingClassName )
? factory.getServiceRegistry().requireService( ClassLoaderService.class )
.classForName( resultSetMappingClassName )
: null,
resultClass,
querySpaces,
getCacheable(),
getCacheRegion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,15 +629,15 @@ private static List<PropertyData> collectClassElements(
//embeddable elements can have type defs
final PropertyContainer container =
new PropertyContainer( returnedClassOrElement, annotatedClass, propertyAccessor );
addElementsOfClass( classElements, container, context);
addElementsOfClass( classElements, container, context, 0 );
//add elements of the embeddable's mapped superclasses
XClass subclass = returnedClassOrElement;
XClass superClass;
while ( isValidSuperclass( superClass = subclass.getSuperclass(), isIdClass ) ) {
//FIXME: proper support of type variables incl var resolved at upper levels
final PropertyContainer superContainer =
new PropertyContainer( superClass, annotatedClass, propertyAccessor );
addElementsOfClass( classElements, superContainer, context );
addElementsOfClass( classElements, superContainer, context, 0 );
if ( subclassToSuperclass != null ) {
subclassToSuperclass.put( subclass.getName(), superClass.getName() );
}
Expand Down Expand Up @@ -668,7 +668,7 @@ private static void collectSubclassElements(
assert put == null;
// collect property of subclass
final PropertyContainer superContainer = new PropertyContainer( subclass, superclass, propertyAccessor );
addElementsOfClass( classElements, superContainer, context );
addElementsOfClass( classElements, superContainer, context, 0 );
// recursively do that same for all subclasses
collectSubclassElements(
propertyAccessor,
Expand Down Expand Up @@ -739,7 +739,7 @@ private static List<PropertyData> collectBaseClassElements(
while ( !Object.class.getName().equals( baseReturnedClassOrElement.getName() ) ) {
final PropertyContainer container =
new PropertyContainer( baseReturnedClassOrElement, annotatedClass, propertyAccessor );
addElementsOfClass( baseClassElements, container, context );
addElementsOfClass( baseClassElements, container, context, 0 );
baseReturnedClassOrElement = baseReturnedClassOrElement.getSuperclass();
}
return baseClassElements;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,8 @@ private static PropertyData getUniqueIdPropertyFromBaseClass(
inferredData.getPropertyClass(),
propertyAccessor
);
addElementsOfClass( baseClassElements, propContainer, context );
final int idPropertyCount = addElementsOfClass( baseClassElements, propContainer, context, 0 );
assert idPropertyCount == 1;
//Id properties are on top and there is only one
return baseClassElements.get( 0 );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,11 @@ private ElementsToProcess getElementsToProcess() {
clazz,
accessType
);
int currentIdPropertyCount = addElementsOfClass(
idPropertyCount = addElementsOfClass(
elements,
propertyContainer,
buildingContext
);
idPropertyCount += currentIdPropertyCount;
buildingContext,
idPropertyCount );
}

if ( idPropertyCount == 0 && !inheritanceState.hasParents() ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -555,17 +555,17 @@ private void validateOptimisticLock(OptimisticLock optimisticLock) {
/**
* @param elements List of {@link PropertyData} instances
* @param propertyContainer Metadata about a class and its properties
* @param idPropertyCounter number of id properties already present in list of {@link PropertyData} instances
*
* @return the number of id properties found while iterating the elements of
* {@code annotatedClass} using the determined access strategy
* @return total number of id properties found after iterating the elements of {@code annotatedClass}
* using the determined access strategy (starting from the provided {@code idPropertyCounter})
*/
static int addElementsOfClass(
List<PropertyData> elements,
PropertyContainer propertyContainer,
MetadataBuildingContext context) {
int idPropertyCounter = 0;
MetadataBuildingContext context, int idPropertyCounter) {
for ( XProperty property : propertyContainer.propertyIterator() ) {
idPropertyCounter += addProperty( propertyContainer, property, elements, context );
idPropertyCounter = addProperty( propertyContainer, property, elements, context, idPropertyCounter );
}
return idPropertyCounter;
}
Expand All @@ -574,20 +574,20 @@ private static int addProperty(
PropertyContainer propertyContainer,
XProperty property,
List<PropertyData> inFlightPropertyDataList,
MetadataBuildingContext context) {
MetadataBuildingContext context,
int idPropertyCounter) {
// see if inFlightPropertyDataList already contains a PropertyData for this name,
// and if so, skip it..
for ( PropertyData propertyData : inFlightPropertyDataList ) {
if ( propertyData.getPropertyName().equals( property.getName() ) ) {
checkIdProperty( property, propertyData );
// EARLY EXIT!!!
return 0;
return idPropertyCounter;
}
}

final XClass declaringClass = propertyContainer.getDeclaringClass();
final XClass entity = propertyContainer.getEntityAtStake();
int idPropertyCounter = 0;
final PropertyData propertyAnnotatedElement = new PropertyInferredData(
declaringClass,
property,
Expand Down
Loading
Loading