Commit Graph

12891 Commits

Author SHA1 Message Date
Steve Ebersole 2ea226999d HHH-18728 - Allow mixed discriminator-value mappings for ANY
HHH-18729 - Allow custom strategy for implicit discriminator-value determination for ANY
2024-11-06 20:05:36 -07:00
Gavin King 7fda1e0ebd some minor cleanups
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-07 01:24:09 +01:00
Andrea Boriero de6aa69fb0 HHH-18633 Split Jandex-based scanning into new module/artifact 2024-11-06 09:26:50 -07:00
Andrea Boriero 5280e15ba0 HHH-18522 Drop hard requirements on Jandex 2024-11-06 09:26:49 -07:00
Gavin King cf0ab77cf2 HHH-18815 introduce Generator.generatedBeforeExecution()
so that GeneratedGeneration does not need to implement BeforeExecutionGenerator

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King 5fca1206b2 HHH-18815 @Generated should not imply @Immutable
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King 51254568df HHH-18815 add Generator.allowMutation()
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King 731a5dbdd5 HHH-18815 clarify and test semantics of @Generated and @Immutable
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King 00f6115b42 version reset should not be affected by the id being assigned or generated
improve javadoc for this stuff

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King b948fde3b3 HHH-18815 allow update of @Generated fields
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Gavin King b83a7fef80 HHH-18809 improve the test
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-06 14:45:23 +01:00
Marco Belladelli 9886b7acf9 HHH-18564 Handle attribute converters for query literals
Allow both domain and relational forms when an attribute converter is present
2024-11-05 16:59:42 +01:00
Marco Belladelli d1980cba14 HHH-18564 Add test for issue 2024-11-05 16:59:42 +01:00
nathan.xu 3153bce9b5 HHH-18808 remove logging when keyword is used as identifier in HqlParser.g4 2024-11-05 14:25:30 +01:00
Christian Beikov f7c5ff28f0 HHH-18792 Add JSON aggregate support for H2 2024-11-05 13:23:22 +01:00
Gavin King 7fec477bc2 HHH-18809 update Javadoc with this usage
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-05 00:21:39 +01:00
Gavin King e4b52c2cf1 HHH-18809 auto-disable use of getGeneratedKeys() when there is a @Formula
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-05 00:21:39 +01:00
Gavin King fc1d0f5456 minor changes
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-05 00:21:39 +01:00
Gavin King e60d674bfe HHH-18809 support @Formula @Generated
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-05 00:21:39 +01:00
Gavin King 18ccd6ed80 HHH-18783 some cleanups, and leave a big TODO
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 20:58:38 +01:00
Gavin King 050da72ae9 HHH-18783 test for trailing space handling in cast()
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 20:58:38 +01:00
Čedomir Igaly 4fbade6076 HHH-18783 Removed @SkipForDialect from test case
Method getSqlType for java.lang.Character without length should return "char(1)", not "char"
2024-11-04 20:58:38 +01:00
Gavin King c0a14334d1 some misc cleanups to mapping package
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 18:15:17 +01:00
Gavin King 4dcfdb57e5 add missing @Override annotations, light refactoring
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Gavin King f9e544e394 improve javadoc
experiment with transferTo() to copy Blob/Clob streams instead of getSubString()

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Gavin King 35b97a040e package reorg for some Blob/Clob-related types
stop using Proxy to implement Clob/NClob
(this is more consistent with BlobProxy)

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Gavin King d4b2d0fb9f fix a bug in ClobProxy
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Gavin King 2d9f58ae4b HHH-18806 attempt to make handling of Clob/NClob more robust
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Gavin King 1ef22c01f3 HHH-18806 fix nationalized strings on Sybase jTDS
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-04 16:32:03 +01:00
Marco Belladelli 1c87d73d2e HHH-18569 Don´t implicitly cast when using a subtype attribute name with Criteria API 2024-11-04 10:35:19 +01:00
Marco Belladelli c1cbbf1fd5 HHH-18569 Add test for issue 2024-11-04 10:35:19 +01:00
nathan.xu afa550b9ec HHH-18807 Fix a bug in HqlLexer.g4 2024-11-04 08:46:19 +01:00
Marco Belladelli e06da88b42 HHH-17612 HHH-18762 Separate envers default revision entity types from mapped-superclasses
Also, ensure they're query-able through Criteria and HQL queries
2024-11-01 11:52:56 -05:00
Gavin King eb41dbd47f consistent code formatting in grammar
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-11-01 16:48:54 +01:00
Jan Schatteman a99628a2e6 HHH-17630 - Add test for issue
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2024-11-01 00:49:38 +01:00
Christian Beikov e1a8990358 HHH-18759 Add xmltable() set-returning function 2024-10-31 18:04:05 +01:00
Christian Beikov 854a982927 HHH-18758 Add json_table() set-returning function 2024-10-31 18:04:05 +01:00
Gavin King 3deb8a5467 Sybase also strips trailing spaces
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King eb6f7a0774 add missing @Override annotations
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 633f1012e1 recover previous workaround for problem with MySQL char(n) type
This is needed to remain compatible with schemas we produced in the past,
even though we're nor preferring varchar(1) for storing Java char.

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King a389f771bf avoid use of char(n) types on MySQL
MySQL strips trailing space characters from char(n) columns,
which is very bad, because we use char(1) for storing Java
char values.

We can sort-of compensate for this in CharacterJavaType,
but it's ugly and fragile to do it that way.

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 3c793c7a30 inline a redundant variable
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 08f25cf8d9 spotless changes
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King ddc2b36bbe disable a test on MySQL
MySQL cast() doesn't do truncation, this never worked properly

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 920d4bce44 throw CoercionException when CharacterJavaType receives a string of wrong length
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 7df56dadda more work on flow typing in the JavaTypes
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 16a15ea6ac cleanups in descriptor.java package
- delete a duplicate class
- fix some incorrect usage of that class
- continue using more flow typing

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 2924fe8875 treat an empty string as a null character in CharacterJavaType conversion
an empty string should not be converted to a space char

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 26988dd536 start using flow typing in the JavaTypes
- but definitely not done with this

squash

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King 65bc730cc1 use switch expressions in isWider() impls
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-31 16:31:40 +01:00
Gavin King d6e85b0a44 move GenerationTarget to the SPI package, since it's exposed by the SPI
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-29 18:07:17 +01:00
Gavin King c037d74bbc move TableMigrator to the SPI package
I must have just made a mistake when I created this interface

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-29 18:07:17 +01:00
stringintech e676ebe62e HHH-18764 Fix incorrect type resolution in ManyToOneType dirty check 2024-10-29 11:43:12 +01:00
Karel Maesen b5fb125425
HHH-18760 - CockroachDB dialect remaps serialization error (#9152) 2024-10-29 10:40:02 +01:00
Marco Belladelli ac74e3b4e7 HHH-18777 EntityHolder map optimization to avoid double accesses 2024-10-28 17:16:49 +01:00
Christian Beikov 9622f1965b HHH-18689 Maintain proxy targets when converting cache entries 2024-10-28 13:12:49 +01:00
Konrad Kügler c7f8813b70 HHH-18689 Test FULL query cache sometimes incomplete 2024-10-28 13:12:49 +01:00
Christian Beikov e024bd0568 HHH-18773 Deduplicate result initializers to avoid double initialization issues 2024-10-28 13:09:10 +01:00
Gavin King b44833b7c9 HHH-18772 introduce AuthException and simplify SQLStateConversionDelegate
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King 55255e9d4a finish big refactor of AbstractMultiIdEntityLoader and children
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King ae538102f9 minor cleanup in Dialect
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King 9828ad7b33 document performance implications of id batching i.e. BatchSize
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King 10c83d8370 further cleanups on multi id loaders
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King 6c5f577223 partial refactoring of AbstractMultiIdEntityLoader and children
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King be895c722b HHH-18767 make MultiIdEntityLoaderArrayParam respect explicit BatchSize
keep ignoring the *implicit* upper limit from the Dialect

refactor a very long method which was extremely hard to understand

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Gavin King 7f7c861f4b HHH-18767 add BatchSize for use with findMultiple()
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-26 16:08:59 +02:00
Jan Schatteman cb0d70309a HHH-17989 - Fix for StatisticsImplementor.closeStatement() never called
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
2024-10-25 14:13:24 +02:00
Marco Belladelli ddf936286f HHH-18494 Always use standard table group in result builder entity
Also ignore placeholder aliases for to-one properties using join-tables, and use the target column name instead
2024-10-25 13:34:59 +02:00
Marco Belladelli 92103ff59c HHH-18494 Add test for issue 2024-10-25 13:34:59 +02:00
Čedomir Igaly bdc0070d97 HHH-18446 Added default SQL type code to LongVarbinaryJdbcType abd LongVarcharJdbcType 2024-10-24 08:57:11 +02:00
Čedomir Igaly b5b195740b HHH-18446 Test case 2024-10-24 08:57:11 +02:00
Christian Beikov 82b20a0e90 HHH-18731 Add generate_series() set-returning function 2024-10-23 18:29:20 +02:00
Steve Ebersole f9d36118ce HHH-18620 - Add @NativeGenerator 2024-10-23 06:44:23 -05:00
Karel Maesen 7bd50db8ad HHH-18755 - Skip test that causes deadlock
On CockroachDB the method
`testCopyPersistentCollectionReferenceAfterFlush` causes a
deadlock, which is resolved eventually by a TimeoutException.

This problem has been discussed in
https://github.com/cockroachdb/cockroach/issues/61269. The
CockroachDB developers do not see this as a bug that needs to
be fixed. Therefore we skip this test for CockroachDB.
2024-10-23 10:25:44 +02:00
Gavin King 76ab5d7d68 some cleanups and javadoc around SchemaManager
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-23 10:12:56 +02:00
Gavin King 37ce9bb31c HHH-18753 SessionFactory.createEntityManager() should return Session
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-23 08:32:14 +02:00
Gavin King 6c227ed304 Some javadoc about HibernatePersistenceConfiguration
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-23 00:31:24 +02:00
Steve Ebersole b1135b537c HHH-18728 - Allow mixed discriminator-value mappings for ANY 2024-10-22 14:57:40 -05:00
Gavin King f82c581990 HHH-18743 make batching explicit for StatelessSession
1. ignore hibernate.jdbc.batch_size setting
2. add insertMultiple() and friends

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-22 21:21:49 +02:00
Steve Ebersole dd8e186416 HHH-18644 - New and improved hibernate-maven-plugin 2024-10-22 08:50:09 -05:00
Andrea Boriero 356b7f54bb HHH-18719 Previous row state reuse can provide detaches entities to the consumer 2024-10-22 13:31:58 +02:00
Réda Housni Alaoui 96c61c3837 HHH-18719 Previous row state reuse can provide detached entities to the consumer 2024-10-22 13:31:58 +02:00
Andrea Boriero f2856cf2ec HHH-18671 Fix setting name (spelling) 2024-10-22 12:08:12 +02:00
Andrea Boriero 58254e585c HHH-18720 Type check on select columns in union all gives SemanticException when there is a null column 2024-10-22 11:46:24 +02:00
Andrea Boriero 8e27a8d185 HHH-18720 Add test for issue 2024-10-22 11:46:24 +02:00
Gavin King 1b00f690ce remove two default impls that threw UnsupportedOperationException
added some links in Javadoc

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-21 22:38:05 +02:00
Andrea Boriero 0f35a7d14c HHH-18702 Exception using @EmbeddedId with @OneToMany that refers to an alternate key column 2024-10-21 18:38:35 +02:00
Andrea Boriero 9894ed98fc HHH-18702 Add test for issue 2024-10-21 18:38:35 +02:00
Gavin King cc93ed7d62 HHH-18749 deprecate Session.get()
This method is essentially redundant as things stand today,
and I want to open up the possibility of changing its semantics
in the future.

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-21 16:59:07 +02:00
Andrea Boriero cbca294770 HHH-18713 HHH-18614 Add test to show issue does not persist with merge 2024-10-21 16:48:15 +02:00
Marco Belladelli bf5c499f68 HHH-18690 Add internal test methods to SchemaTruncatorImpl 2024-10-21 15:13:41 +02:00
Marco Belladelli 810842ac74 HHH-18679 Allow `@Generated(writable=true)` with assigned identifiers 2024-10-21 15:03:21 +02:00
Marco Belladelli 7b81b4d5e5 HHH-18679 Add test for issue 2024-10-21 15:03:21 +02:00
Gavin King e868c8c3cd HHH-18748 Add missing overloads of find() to Session
It was always weird and inconsistent that you sometimes had to use get(),
and this is also better documented this way (i.e. Hibernate-specific
semantics of find() are not documented by EntityManager)

Also add some missing @Overload annotations

Also move some impl down off the interface

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-21 11:43:09 +02:00
Gavin King 63d3d32f42 rename findAll -> findMultiple, getAll -> getMultiple 2024-10-20 20:53:19 +02:00
Gavin King 86db807e22 major cleanup to BaseSqmToSqlAstConverter
this class was full of EXTREMELY long methods and lots of typecasts

Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-20 17:56:43 +02:00
Gavin King 26efd4e530 squash some warnings by filling in <?>
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-20 15:00:09 +02:00
Gavin King 5db7629382 improve jdoc of SQM enums
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-20 15:00:09 +02:00
Gavin King ddca820f42 HHH-17068 move JoinType to common
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-20 15:00:09 +02:00
Gavin King 0393df8761 HHH-17068 move layer-breaking enums from o.h.q.sqm to o.h.q.common
Signed-off-by: Gavin King <gavin@hibernate.org>
2024-10-20 15:00:09 +02:00