Commit Graph

1922 Commits

Author SHA1 Message Date
Mark Struberg 2d3c6e6ee0 clean up unit test
no need to call em.persist inside the loop on the same entity over again.
2021-04-06 11:58:19 +02:00
Mark Struberg 044c7d27b1 OPENJPA-2860 PostgreSQL >= 10 supports setQueryTimeout 2021-04-05 18:16:48 +02:00
Mark Struberg 1fb5234574 OPENJPA-2665 use modern for loops
no functional change, just java lang updates
2021-04-05 08:47:46 +02:00
Mark Struberg d73e2e72f0 collapse Exceptions and use Diamond style 2021-04-04 18:32:35 +02:00
Mark Struberg a7708636e3 remove unecessary boxing/unboxing - no functional change 2021-04-04 17:54:25 +02:00
Mark Struberg b0ba9c3e60 code cleanup without functional change
* remove unecessary valueOf
* remove ;;
* remove unused imports
* remove unnecessary casts
* etc
2021-04-04 17:09:04 +02:00
Mark Struberg 9458d1720b remove obsolete commented out code and modifiers 2021-04-04 16:22:26 +02:00
Mark Struberg 1c30090c8c OPENJPA-2859 use DOUBLE instead of NUMERIC
by default NUMERIC has no fraction digits, so rather use
DOUBLE data type which is a 64bit double value.
2021-04-04 13:51:21 +02:00
Mark Struberg e68083e8d0 move to org.junit.Assert 2021-04-03 18:04:22 +02:00
Mark Struberg 495fe202a3 disable test for databases which cannot handle large PKs
On MariaDB and MySQL the allowed size of compound primary keys is very limited.
This very test will not work with them. It's nothing JPA can heal, users
are restricted and have to work around it.
2021-04-03 16:08:56 +02:00
Mark Struberg ab8090f556 OPENJPA-2856 improve MariaDB TIME handling
* java.sql.Time parameters must be on date Jan 1st 1970, otherwise MariaDB won't find anything in the DB
* from > 10 onwards MariaDB supports up to 6 fractions in TIME as well.
2021-04-03 08:42:28 +02:00
Mark Struberg 53cc83eb7e OPENJPA-1303 "KEY" is also a reserved word for columns 2021-04-02 18:00:03 +02:00
Mark Struberg 8f96a5bd79 OPENJPA-2851 fix CURRENT_DATE with LocalDate and LocalDateTime
bug in unit test
2021-04-01 23:30:59 +02:00
Mark Struberg bd3f8ed57e fix checkstyle 2021-04-01 23:15:26 +02:00
Mark Struberg 6db4db7f51 OPENJPA-2851 fix CURRENT_DATE with LocalDate and LocalDateTime 2021-04-01 21:59:36 +02:00
Mark Struberg 5b46dcc191 connection handling fixed
Connection was set to autoCommit, so no commit or rollback possible
2021-04-01 16:46:42 +02:00
Mark Struberg 93fe064300 Also disable for Oracle
Oracle also closes the JDBC Stream.
Most likely all other DBs now do it as well.
2021-04-01 16:45:37 +02:00
Mark Struberg f1871782cd fix a test to also work with MSSQL
SQL Server doesn't know BLOB data type, use IMAGE works
2021-03-31 21:40:01 +02:00
Mark Struberg e9f3f9cdfc OPENJPA-2883 fix handling of java.sql.Time on MSSQL 2021-03-31 19:11:08 +02:00
Mark Struberg 6a47c4c033 OPENJPA-1303 ColumnDefIdentifierRule did not use invalidColumnWordSet 2021-03-31 00:29:51 +02:00
Mark Struberg 80a16896f1 disable MSSQL from LOB stream tests
From the MS SQL Server documentation, it looks like JDBC4 drivers changed the behaviour.
"The next call to a getter method implicitly closes the stream".
Thus storing the InputStream in an entity will always result in a closed stream.
Since JDBC4 all drivers should behave that way actually.
And this is a sane way to prevent file handle leaks.
2021-03-30 21:44:43 +02:00
Mark Struberg 1a8bcfb6b1 OPENJPA-2849 fix UnaryOp to use DBDictionary
UnaryOps should use the DBDictionary to resolve the requested data whenever possible.
Previously we always have been requesting JDBC native types when doing max(), min(), etc.
But this returns values of types which we potentially cannot handle.
2021-03-30 14:38:14 +02:00
Mark Struberg 72df0228ca OPENJPA-2849 coerc native java.sql types to java.time
Many JDBC driver support old java.sql types for select max, min, etc.
Those need to get converted to java.time.* on demand.
2021-03-28 19:36:32 +02:00
Mark Struberg aeb333fb3a add an explicit lifecycle id
This now allows to invoke the antrun plugin via
$> mvn antrun:run@enhance
2021-01-14 13:55:50 +01:00
Mark Struberg 00bd91cc2c OPENJPA-2788 fix anynomous Criteria Parameters 2020-12-14 14:13:32 +01:00
Romain Manni-Bucau 33fc72ac85 [OPENJPA-2831] import [collections4] used classes and drop the dependency 2020-09-16 12:17:13 +02:00
Mark Struberg 8f3e1bc21a make derby Driver optional
Skip this test if the class is not on the classpath.
This basically happens with every profile other than test-derby
2020-09-05 19:28:28 +02:00
Enrico Olivelli e3bb1f1657
OPENJPA-2818 DBDictionary > delimitIdentifiers = true does not work (#69) 2020-07-21 14:43:40 +02:00
Mark Struberg f18f28b633 [maven-release-plugin] prepare for next development iteration 2020-07-07 11:19:15 +02:00
Mark Struberg 66d2a72cb2 [maven-release-plugin] prepare release 3.1.2 2020-07-07 11:19:15 +02:00
Romain Manni-Bucau e721abfdaa ensure TestSnakeCaseDDL runs in enhanced mode otherwise there is an issue in column name uniqueness check + fixing MappingDefaultsImpl name definition 2020-05-07 10:02:45 +02:00
Romain Manni-Bucau d0875670dd OPENJPA-2812 snake_case support in dbdictionary for db column names 2020-04-29 20:47:28 +02:00
Mark Struberg ff2a1e6c1f OPENJPA-2807 trim spaces from column names
@Index(columnList="a, b, c") used to not trim the spaces.
Thus it was looking for a column "a ", "b " and "c " which obviously could
not be found.
2020-04-25 20:11:04 +02:00
Maxim Solodovnik 44c4d8dc02 [OPENJPA-2798] Automatic-Module-Name is added 2020-03-15 15:59:45 +07:00
Mark Struberg 962cbbc624 Revert "[OPENJPA-2798] java11 friendly (#57)"
this introduces a dependency which requires attribution. No need to imo

This reverts commit 7ec0015edf.
2020-02-29 16:05:56 +01:00
Mark Struberg fd9585839a [maven-release-plugin] prepare for next development iteration 2020-02-14 12:12:11 +01:00
Mark Struberg 1440702eec [maven-release-plugin] prepare release 3.1.1 2020-02-14 12:12:01 +01:00
Maxim Solodovnik 7ec0015edf
[OPENJPA-2798] java11 friendly (#57)
* [OPENJPA-2798] geronimo-jpa_2.2_spec is replaced with jakarta.persistence, Automatic module names are added
2020-01-16 20:00:56 +07:00
Romain Manni-Bucau ef98e18480 OPENJPA-2743 skip AttributeConverter when loading the Metamodel and preparing the broker to avoid to fail if it was registered in persistent classes (allowed in JPA to bypass scanning but enable converters) 2019-07-29 17:40:09 +02:00
Mark Struberg 9f26ed29bf [maven-release-plugin] prepare for next development iteration 2019-04-10 20:13:15 +02:00
Mark Struberg afcec21a1d [maven-release-plugin] prepare release 3.1.0 2019-04-10 20:13:04 +02:00
Mark Struberg f9b59689d4 OPENJPA-2733 OPENJPA-2785 fix broken spring data usage.
spring-data potentially does something unspecified.
This hack now prevents duplicate ParameterExpressions with the same name
while not having to implement equals + hashCode for it - which makes Spring happy.
2019-04-10 16:05:21 +02:00
Mark Struberg a7969c120b OPENJPA-2555 rename DBDictionary property to dateFractionDigits
dateFractionDigits is more self-explaning than defaultFractionDigits.
It also fits better into the already existing date* config settings.
2019-04-05 13:58:05 +02:00
Mark Struberg dc31b800b8 OPENJPA-2555 fix randomly failing tests by forcing microseconds 2019-04-05 12:57:23 +02:00
Mark Struberg 64af85106a fix random failing behaviour if id did already exist 2019-04-05 11:07:53 +02:00
Mark Struberg 4e59c48364 OPENJPA-2555 use a defaultFractionLength of 0 for backward compat
This is how the default of MySQL and the previous behaviour of OpenJPA did.
If a user want he can use either @Column(scale=n) or set it via DBDictionary:
openjpa.jdbc.DBDictionary=(defaultFractionLength=6)
2019-04-05 10:29:27 +02:00
Mark Struberg 11cfff3f78 move to 3.1.0-SNAPSHOT as we upped the jpa-spec API to 2.2 2019-03-31 22:32:56 +02:00
Maxim Solodovnik 75999ad5d9 [OPENJPA-2780] reverse customizer adds @Enumerated annotation as expected 2019-03-22 12:21:32 +07:00
Maxim Solodovnik cb20dd6b95
[OPENJPA-2777] Javax index (#39)
[OPENJPA-2777] javax.persistense.Index can be used on Table annotation
2019-03-05 20:44:49 +07:00
Mark Struberg 0e4ec5b392 OPENJPA-2733 fix param index.
Also handle the case if the same Param gets registered multiple times.
This eg happens in case of a Criteria Subquery having the same parameter name.
2019-02-14 15:06:50 +01:00
Mark Struberg 80736f6e9d OPENJPA-2733 subquery parameters are incorrectly assigned
patch submitted by Pawel Veselov - thanks!
2019-02-14 14:29:11 +01:00
Mark Struberg 238449e155 hsqldb seems to have a bug with concurrent access to the underlying DB. 2019-02-06 10:23:22 +01:00
Mark Struberg 6e8c4d987f fix broken unit test. Illegal table 'ROLES'
The ROLES table exists by default in some datbases.
So it's probably better to not use it as table name in our unit test.
2019-02-02 13:49:27 +01:00
Mark Struberg 4b88b80dc0 remove obsolete sql tracing 2019-02-02 13:47:53 +01:00
Mark Struberg 25cde67172 test cleanup
* remove unused methods
* fix formatting
* delete entries owt we will randomly blow up
2019-02-02 12:08:57 +01:00
Mark Struberg 17ef63bbe4 Those 2 tests only work when running on Derby.
They hardcoded slurp in some derby driver via simple-ldap.
Thus they only work if the derby profile is activated.
In any other case those tests blow up with a CNFE.
2019-02-02 12:06:57 +01:00
Mark Struberg e908a9c293 formatting only 2019-01-28 13:01:16 +01:00
Mark Struberg 5079209823 Merge branch 'OPENJPA-2713' 2019-01-25 17:13:55 +01:00
Mark Struberg 6d2544f390 OPENJPA-2713 properly handle WITH TIME ZONE if supported by db
This includes handling the  new java.sql.Types.TIME_WITH_ZONE
and DATE_WITH_ZONE.
2019-01-25 16:42:15 +01:00
Romain Manni-Bucau 9e222652df OPENJPA-2770 ensure equal(xxx, literal(boolean)) works in criteria builder 2019-01-23 10:21:53 +01:00
Mark Struberg dbfb360e85 OPENJPA-2713 add OffsetTime support
Works, but something is a bit fishy still.
2019-01-22 22:07:32 +01:00
Mark Struberg e57fd518b3 OPENJPA-2713 implement native java8 types
Since some DBs (e.g. PostgreSQL) do support LocalDate, etc
in their JDBC drivers, it's probably the best to support it
on a way deeper level.
2019-01-20 23:51:10 +01:00
Mark Struberg 89335fd48c OPENJPA-2713 add support for java.time.LocalDate
plus some cleanup
2019-01-20 14:49:20 +01:00
Mark Struberg 260042ba51 OPENJPA-2764 fix tests with random behaviour
The behaviour was random due to the undefined order in which
real databases return data.
2019-01-02 09:58:03 +01:00
Maxim Solodovnik d874cbf6d3
[OPENJPA-2754] maxActive -> maxTotal (#24)
* [OPENJPA-2754] maxActive -> maxTotal

* commons-pool2 and commons-dbcp2 versions are updated, setMaxActive is deprecated with warn being logged

* DBCPDriverDataSource and AutoDriverDataSource are removed

* BasicDataSource is being loaded in case jdbc.DriverDataSource is set to 'dbcp'

* Normal call is replaced with reflection
2018-11-16 13:48:40 +07:00
Mark Struberg 60ccac0e22 OPENJPA-2753 postgres doesn't know BLOG
have to use BYTEA instead.
2018-11-10 16:45:24 +01:00
Mark Struberg 7bc09297f8 OPENJPA-2753 fix schema creation with PostgreSQL
the test methods run random.
It doesn't make sense to create the other schemas only for a single of those tests.
Possibly the order was deterministic in junit3 which is a long time gone now.
2018-11-10 10:38:25 +01:00
Mark Struberg 8d41f3da9c OPENJPA-2753 fix testBatchLimit test for PostgreSQL 2018-11-09 09:04:59 +01:00
Mark Struberg eaecedf328 fix more broken tests due to lazy Id generation 2018-11-03 14:25:23 +01:00
Mark Struberg ba7b8493ca fix weird equals error.
most probably happens on subclassing when access to _id
doesn't getnerate the sequence. Happened randomly though.
So not 100% sure to have fixed it that way :(
2018-11-03 12:19:36 +01:00
Mark Struberg 34c99b342a OPENJPA-2554 fix TestSchemaGenerationProperties on MySQL
MySQL on unix has case sensitive table names...
2018-11-02 22:23:28 +01:00
Mark Struberg 4bb1caa36d OPENJPA-2567 @Lob on String results in TEXT not BLOB 2018-11-02 10:38:53 +01:00
Mark Struberg 0530b5b72b OPENJPA-2755 OPENJPA-2555 support fractions of a second
For now just in MySQL. Should also get added to PostgreSQL.
Txs also to Ancoron Luciferis for a patch which also
gave some important input!
2018-11-01 21:06:41 +01:00
Mark Struberg 3b4c2e6f42 OPENJPA-2755 OPENJPA-2555 use scale to set Date fractions 2018-11-01 14:20:49 +01:00
Mark Struberg 9461ffdfcd OPENJPA-2775 OPENJPA-2555 fraction of seconds in MySQL
This is a first fix for supporting fractions of a second in MySQL.
2018-10-31 20:51:31 +01:00
Mark Struberg 9d4b2ece3b OPENJPA-2753 deduplicate database configurations
various DB configs got moved to the parent pom to have it
available in all modules without the need to copy them through.
2018-10-23 10:33:25 +02:00
Mark Struberg 3bd73ab7d8 OPENJPA-2753 introduce Docker for mysql 2018-10-22 21:06:43 +02:00
Maxim Solodovnik 9a5096308c [OPENJPA-2752] libraries are updated to most recent versions 2018-10-18 12:38:31 +07:00
Maxim Solodovnik e25438a174 [OPENJPA-2751] imports, @Overrides and @Deprecated are organized, redundant type arguments and unnecessary casts are removed
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1842686 13f79535-47bb-0310-9956-ffa450edef68
2018-10-03 08:11:59 +00:00
Maxim Solodovnik f2fc98031e [OPENJPA-2751] trailing white-spaces were removed
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1842614 13f79535-47bb-0310-9956-ffa450edef68
2018-10-02 12:32:32 +00:00
Maxim Solodovnik 4709f38ba2 [OPENJPA-2748] commons-collection is updated to most recent version
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1841941 13f79535-47bb-0310-9956-ffa450edef68
2018-09-25 15:16:54 +00:00
Francesco Chicchiriccò f399f912cf [OPENJPA-2750] Commons dbcp is updated to latest version - thx @solomax - This closes #22
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1841800 13f79535-47bb-0310-9956-ffa450edef68
2018-09-24 06:41:20 +00:00
Francesco Chicchiriccò 9a98d6a2bf [OPENJPA-2567] various MySql and MariaDB text types support is added - thanks @solomax - This closes #18
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1839940 13f79535-47bb-0310-9956-ffa450edef68
2018-09-03 11:41:07 +00:00
Will Dazey 4477ace6fd OPENJPA-2704: The openjpa.jdbc.Schema no longer overrides orm.xml default
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1834900 13f79535-47bb-0310-9956-ffa450edef68
2018-07-02 21:07:29 +00:00
Mark Struberg ffe3fe4a50 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1833210 13f79535-47bb-0310-9956-ffa450edef68
2018-06-08 20:34:53 +00:00
Mark Struberg 101ee9946a [maven-release-plugin] prepare release openjpa-parent-3.0.0
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1833208 13f79535-47bb-0310-9956-ffa450edef68
2018-06-08 20:34:24 +00:00
Will Dazey 8be86a6903 OPENJPA-2646: Sporadic NullPointerException and ClassCastException caused by query cache misses in multithreaded environments.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1831596 13f79535-47bb-0310-9956-ffa450edef68
2018-05-14 22:25:05 +00:00
Mark Struberg 7be184d451 cleanup import minor
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1831459 13f79535-47bb-0310-9956-ffa450edef68
2018-05-12 09:37:30 +00:00
Jody Grassel 5c94a7ff67 OPENJPA-2705: ArrayOutOfBoundsException occurs with an @EmbeddedId (commit on wdazeys behalf)
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1802529 13f79535-47bb-0310-9956-ffa450edef68
2017-07-20 20:11:40 +00:00
Francesco Chicchiriccò 8f1f9a1af7 [OPENJPA-2698] Applying the provided patch
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1793617 13f79535-47bb-0310-9956-ffa450edef68
2017-05-03 06:45:58 +00:00
Romain Manni-Bucau af8ea38f87 OPENJPA-2554 JPA 2.1 - Schema Generation, patch from Roberto Cortez, doc to update still
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1770509 13f79535-47bb-0310-9956-ffa450edef68
2016-11-19 18:08:44 +00:00
Mark Struberg bdc1da9423 OPENJPA use Locale.ENGLISH for toLowerCase and toUperCase where possible
* we now use fixed english Locale for 'framework parts' which are by spec portable
* we do NOT yet use a fixed Locale for anything related to column or table names!

txs to Kaloyan Spiridonov for the catch!



git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1768216 13f79535-47bb-0310-9956-ffa450edef68
2016-11-05 13:46:23 +00:00
Mark Struberg 9cacf08c7a OPENJPA-2662 remove unused imports
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1759916 13f79535-47bb-0310-9956-ffa450edef68
2016-09-08 22:03:41 +00:00
Mark Struberg f0286a268e OPENJPA-2665 refactor StringUtils
We now got rid of commons-lang. Makes 400kB less dependencies 
And guaranteed no classpath conflicts.


git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1759663 13f79535-47bb-0310-9956-ffa450edef68
2016-09-07 19:04:18 +00:00
Mark Struberg 209adb6fc8 OPENJPA-2662 remove serp.util.Strings.getPackageName
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1759356 13f79535-47bb-0310-9956-ffa450edef68
2016-09-05 21:11:01 +00:00
Mark Struberg 297190a43a OPENJPA-2662 reimplement serp.util.Strings#getClassName
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1759355 13f79535-47bb-0310-9956-ffa450edef68
2016-09-05 20:35:11 +00:00
Mark Struberg 305758fc96 OPENJPA-2664 move to commons-lang3
And also clean up ancient code parts.


git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1758808 13f79535-47bb-0310-9956-ffa450edef68
2016-09-01 16:27:51 +00:00
Heath Thomann 843398ede4 OPENJPA-2650: Made a very simple test update to the test created for this JIRA.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1757894 13f79535-47bb-0310-9956-ffa450edef68
2016-08-26 17:09:54 +00:00
Mark Struberg 13cdb6fd47 explicit table names for all the Entity1 to better understand what exactly blows up on Jenkins
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1757650 13f79535-47bb-0310-9956-ffa450edef68
2016-08-25 10:07:50 +00:00
Mark Struberg 3d4f675038 fix serializable exception
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1757131 13f79535-47bb-0310-9956-ffa450edef68
2016-08-22 10:00:11 +00:00