350 Commits
Author SHA1 Message Date
Rob Bygrave 79c96c9ec1 Improve error message in InterceptReadWrite when lazy loading and no default server registered 2023-03-09 17:14:36 +13:00
rob 2e0dba3741 #2981 - ENH: Add profile-line-number-mode with options none | all | auto ... to control adding line numbers to profile locations 2023-02-22 23:02:42 +13:00
rob 34dc4375da Tidy existing given that lineNumber in SpiProfileLocationFactory always comes in as 0
The history behind this is that originally there was a "profileId" concept where that was a int value that could be used as an "id" for a transactional method that we wanted to profile.

That went away and then the idea was that bytecode enhancement would determine the line number and we would use that but that was a bad idea and we ended up with lineNumber always as 0.

These days with StackWalker and DProfileLocation we can do this better that way so yeah. A followup to this is to add to the api a boolean flag as to whether a profile location should be with line numbers (which can change frequently due to refactoring etc)
2023-02-22 15:22:58 +13:00
rob 0b615a79cc Add _ifPresent() expressions for GT, GE, LT, LE (follow up from #2768) 2023-02-22 14:04:26 +13:00
rob b0364f3c42 Use StackWalker for ProfileLocation and CallOrigin 2023-02-21 14:21:18 +13:00
rob fe241d8cce Tidy internals, use Config.getOptional() when reading datasource.default / ebean.default.datasource 2023-02-20 09:07:45 +13:00
Rob BygraveandGitHub b9a502ca85 Merge pull request #2957 from FOCONIS/detailed-evict-stats
ENH: add statistics trimmedByGC/LRU/TTL/Idle to ServerCacheStatistics?
2023-02-14 16:29:35 +13:00
rob 5882169641 Merge branch 'feature/StdExpressions' 2023-02-14 11:35:31 +13:00
rob f694f2946a Rename test to StdOperatorsTest 2023-02-14 11:34:00 +13:00
rob 4c0144de61 Fix SqlOperators for sql injection 2023-02-14 11:33:28 +13:00
rob eb7de343a8 #2963 - [ebean-agent] By default enable @DbArray to be nullable and @Transient field initialisation when generating default constructors 2023-02-14 08:01:48 +13:00
Rob Bygrave 20f6a659fe #2959 - Improve logging for lazy loading error due to "markAsDeleted" 2023-02-07 19:59:33 +13:00
Roland Praml 010f73fea2 ENH: add statistics trimmedByGC/LRU/TTL/Idle to ServerCacheStatistics? 2023-02-02 14:10:54 +01:00
Roland Praml 371f50fb4d NEW: ExpressionList has clear() method 2023-01-23 11:33:29 +01:00
Roland Praml 9ef59e359b Removed supportsSelect (dead code) 2023-01-13 13:43:41 +01:00
Rob Bygrave 95512d4851 #2906 - Tidy LimitOffsetSqlLimiter 2022-12-01 22:27:57 +13:00
Rob Bygrave 37ba0b63e4 #2907 - Promote Db2SqlLimiter to be AnsiSqlRowsLimiter and move to ebean-api module 2022-12-01 22:18:16 +13:00
Rob Bygrave 22a5bd9b9d #2906 - Refactor tidy SqlLimiter implementations 2022-12-01 21:39:00 +13:00
Serhii Dakhnii 3277fe81a1 Fixed mandatory LIMIT generation in case of firstRow>0 2022-11-30 21:36:08 +02:00
Rob Bygrave e87a06a713 #2894 - Lack of setNullParameter() functionality on io.ebean.DtoQuery interface 2022-11-21 17:00:55 +13:00
Rob Bygrave dd7605ac3a #2888 - DatabaseFactory.create() fails with java.lang.InstantiationError: io.ebean.bean.EntityBeanIntercept in multi-module gradle setup 2022-11-15 14:50:34 +13:00
Rob Bygrave 47dfbb6157 #2864 - Not advertise services configurable via DatabaseConfig.putServiceObject() that are "internal"
"internal" meaning that in terms of module-path they are not in a properly exported package. For example,
they are in a subpackage of io.ebeaninternal
2022-11-10 13:11:08 +13:00
Rob BygraveandGitHub 013123c1a7 Merge pull request #2864 from FOCONIS/feature/override-service-objects
NEW: Override service objects with DatabaseConfig.putServiceObject
2022-11-10 13:05:22 +13:00
Rob Bygrave 3c8c52ca7f Simplify to use single type (not use another different type for Query.Property) 2022-11-09 23:30:51 +13:00
Rob Bygrave d29ef8934d Add more operators to StdOperators
- stricter use of UpdateQuery.set()
- Numbers just use their own type - PBaseNumber
- PEnum just uses its own type
- Expr.factory() to expose factory
2022-11-09 17:47:16 +13:00
Rob Bygrave 97bbce321d Make Query.Property parameterised with <BT> "Base Type" as Number, String, Temporal, Boolean or Object
These types then determine which functions are valid for the types. So:
- Number functions
- String/varchar functions
- Temporal Date, DateTime, Time functions
- Boolean functions
- Object being everything else
2022-11-08 21:57:36 +13:00
Rob Bygrave 3da924b943 Add Query.Property.of(), Move StdFunctions to ebean-api 2022-11-07 12:57:39 +13:00
Rob Bygrave 8565f5f807 Rename TQColumn -> Query.Property and move to api + use with UpdateQuery.set()
- Refactor rename TQColumn to Query.Property and move to ebean-api module
- Add UpdateQuery.set() methods to use Query.Property (as per #2849)
2022-11-03 17:33:11 +13:00
Rob Bygrave 0a61852711 #2847 - Add support for Sub-query EQ, NE, LT, LE, GT, GE expressions 2022-11-03 00:22:48 +13:00
Rob Bygrave dd0ed8ea76 #2873 - Query Beans: Support more TQProperty's as target value for inRangeWith() 2022-11-02 17:35:00 +13:00
Roland Praml f8c6a3c960 NEW: Ovverride service objects with DatabaseConfig.putServiceObject 2022-10-25 10:28:55 +02:00
Noemi Praml c855df8b8d javadoc 2022-10-18 07:59:19 +02:00
Rob Bygrave 7df168f232 ENH: Add Transaction.rollbackAndContinue()
Typically useful for handling DuplicateKeyException where we expect
DuplicateKeyException to be thrown and catch it with the intention of
continuing processing using the same transaction.

Note that some databases like Oracle do not require this explicit
rollback() and would work without the rollbackAndContinue(). Postgres
in particular requires the rollback() call on the underlying connection
such that we can continue using that transaction/java.sql.Connection.

Note that in the existing test we can see that rollbackAndContinue()
is pretty close to being syntactic sugar. I think adding rollbackAndContinue()
is justified and complements the existing commitAndContinue().
2022-09-01 17:08:11 +12:00
Rob Bygrave e3e30cafdd Refactor tidy error and log messages - part 2 2022-08-27 17:15:08 +12:00
Rob Bygrave c5e8b217e3 Refactor ScalarType, remove convertFromMillis() method (no longer needed)
Due to the move and change of CsvReader using StringParser ScalarType no longer
needs that general convertFromMillis() method. Note that date and dateTime ScalarTypes
still retain this conversion method.
2022-08-25 22:37:47 +12:00
Rob Bygrave efe80a534c Extract CsvReader - remove built in date, time, dateTime parsing - use StringParser instead
Just always use our own StringParser lambda function instead for parsing date, time and dateTime types.
2022-08-25 22:09:38 +12:00
Rob Bygrave 1aac01ead0 Extract CsvReader - move DefaultCsvCallback and add module-info 2022-08-25 17:49:11 +12:00
Rob Bygrave 216c43eea6 Extract CsvReader into separate ebean-csv-reader module 2022-08-25 17:25:49 +12:00
Rob BygraveandGitHub 4b11147b83 Merge pull request #2801 from ebean-orm/feature/drop-feature-OnQueryOnly
Remove the OnQueryOnly (rollback) feature
2022-08-25 12:30:16 +12:00
Rob Bygrave 10c9b2addd Remove ScalarType.isDateTimeCapable() ... (only used by CSV reader)
So the complexity cost doesn't justify itself against only being used
by CSV reader to validate when assigning a date/time format to a property
/ expression path.
2022-08-25 12:16:37 +12:00
Rob Bygrave 96b674114c Remove the OnQueryOnly (rollback) feature
The better approach these days is to use the read-only datasource with autoCommit
2022-08-25 11:26:55 +12:00
Rob Bygrave 456086fb3c Refactor DatabasePlatform - rename getters to accessors
Although this is public API these getters are not expected to be used
by application code so, I feel comfortable making this change.
2022-08-25 10:34:39 +12:00
Rob Bygrave 341b9a7449 Refactor DatabasePlatform - remove unused method tableExists() 2022-08-25 10:23:14 +12:00
Rob Bygrave 6c7cedc1f1 #2799 - Remove unused DatabasePlatform.treatEmptyStringsAsNull 2022-08-25 10:19:11 +12:00
Rob Bygrave c297ebda5a No effective change, fix typo in DatabasePlatform variable name 2022-08-23 16:09:45 +12:00
Rob Bygrave 4252445eb4 Use AppLog and System.Logger for logging - static imports 2022-08-23 15:18:46 +12:00
Rob Bygrave a23f241fff Use AppLog and System.Logger for logging rather than slf4j-api
The avaje-applog-slf4j dependency means this is still using
slf4j-api for implementation. Remove that dependency and
service load the desired implementation.
2022-08-18 22:44:31 +12:00
Rob Bygrave 6c15115530 #2786 - Support logging Ebean version unknown
We don't really care if we can't determine the version so only log when we can read it.
2022-08-17 17:42:39 +12:00
Rob Bygrave 51d2f52d19 #2782 - Support MariaDB jdbc driver update - Batched JDBC SQLException translation, SqlRow BLOB reading
- Batched JDBC SQLException translation - Need to dig into nested exception to get cause error state
- SqlRow BLOB reading - BLOB can come as LONGVARBINARY (TestRawSqlBuilder)
- Fix test for history using system time (TestHistoryInsert)
- Fix SqlQueryCancelTest
- Fix TestSqlUpdateExceptions
2022-08-17 17:25:28 +12:00
Rob Bygrave d703709f14 #2784 - Correct documentation for TQRootBean.findSingleAttribute with @Nullable 2022-08-12 15:50:17 +12:00