Re: Generating an ERD from Cayenne Model

2024-02-07 Thread Andrus Adamchik
Hi Andrew, Cool! IMO Cayenne model metadata is generally underused, as most developers (myself included) are focusing on the ORM aspect of the framework, and ignore the possibilities that an easily-accessible model brings to the table. So thanks for the example. Andrus > On Feb 7, 2024, at

Re: How to use a custom aggregate function?

2024-01-05 Thread Andrus Adamchik
tRow(LimitResultIterator.java:115) > at > org.apache.cayenne.access.jdbc.LimitResultIterator.allRows(LimitResultIterator.java:95) > at > org.apache.cayenne.access.jdbc.SelectAction.performAction(SelectAction.java:139) > at > org.apache.cayenne.access.DataNodeQueryAction.runQuery

Re: How to use a custom aggregate function?

2024-01-04 Thread Andrus Adamchik
Hi Marc, Upgrading to 4.2 final is probably a good idea regardless of the aggregation function use :) Regarding your question. There are a few ways to approach it (and I wish we could abstract it a bit better) : 1. Instead of someProperty.function(..), try to create a subclass of

Re: How to deal with localized content in the db

2023-11-01 Thread Andrus Adamchik
Hi Riccardo, The best practice is to actually map all those localized columns as explicit properties (Cayenne ObjAttributes), and deal with language switching in the code layer above Cayenne. Thanks, Andrus > On Nov 1, 2023, at 4:27 AM, Riccardo De Menna wrote: > > Hi Everyone, > > I was

ApacheCon in Halifax in October

2023-08-10 Thread Andrus Adamchik
Hi, With my ongoing move from Europe to North America, I am thinking of going to "Community over Code" (ex. ApacheCon) in Halifax in October - https://communityovercode.org/ . Not presenting anything, just to hang around. Anyone in the Cayenne community is in the area and/or planning to

Re: Cayenne 4.2 and 'To Dep PK' direction

2023-06-07 Thread Andrus Adamchik
Hi Tore, I wonder what type of errors are you getting due to that? Andrus > On Jun 7, 2023, at 12:26 AM, Tore Halset wrote: > > Hello. > > Trying to upgrade an old large app from cayenne 4.1.1 to 4.2. We get lots of > test fails with cayenne 4.2. Every fail so far has been that our model

[ANN] Cayenne 4.2 goes GA

2023-05-29 Thread Andrus Adamchik
Very happy to announce that we have a final GA release of Cayenne 4.2 available. It contains a number of bug fixes, most notable being a fix for the recent nasty issue that resulted in missing objects in commits for certain mappings. But of course it is also a huge milestone that was more than

Re: Join ordering

2023-05-21 Thread Andrus Adamchik
Hi Mark, SQL translator in 4.2 is highly customizable via SQLTreeProcessor (returned from DbAdapter). So can you rearrange your joins with a custom adapter / tree processor. Before you do that, please confirm whether this is still a problem with a newer version of Cayenne. Either with 4.2.RC2

Re: Force update of column

2023-04-28 Thread Andrus Adamchik
Hi Lon, certainly not via "standard" means. That logic is not configurable. But everything is customizable of course :) Thanks, Andrus > On Apr 27, 2023, at 12:09 AM, Lon Varscsak wrote: > > Hey all, > > I of course have an unusual situation that I'm not sure how to handle. :) > > I was

Re: Graal (Native Image) with Cayenne

2023-04-05 Thread Andrus Adamchik
ed with > the library jar in some way in order to instruct the Graal build tool. Maybe > once I have this fully working I can add a PR for it to cover the known > classes in the jar(s). > > Regards. > > -- > Andrew Lindesay > > On Wed, 5 Apr 2023, at 20:31, Andrus

Re: Graal (Native Image) with Cayenne

2023-04-05 Thread Andrus Adamchik
Hi Andrew, I don't have first-hand experience, but Cayenne was reported to work with GraalVM. E.g.: https://lists.apache.org/list?user@cayenne.apache.org:2023-1:graalvm Andrus > On Apr 5, 2023, at 10:26 AM, Andrew Lindesay wrote: > > Hello; > > Has anybody here experimented with running

Re: Possible regression on 4.2.RC2

2023-03-09 Thread Andrus Adamchik
Hi Henrique, Thanks for your feedback and testing! > IMO, if RC2 has this unexpected behaviour (!) maybe we should discourage its > usage? I know, it’s only a RC, but Cayenne has always been so stable for me, > never thought twice of using RCs. I'd say we outrun this by releasing "4.2 final"

[ANN] Cayenne 4.0.3 released

2023-03-04 Thread Andrus Adamchik
Hi, a maintenance release of the older Cayenne 4.0 was posted earlier this week. It would allow 4.0 users to run CayenneModeler on Java 17. So if you haven't upgraded your code base yet, you should still be able to work with your models. Enjoy! Andrus

Re: Cayenne web module deprecated

2023-01-31 Thread Andrus Adamchik
Yeah, there's so many ways to create a (web) app these days, that we can't support them all properly. Andrus > On Jan 31, 2023, at 5:49 PM, John Huss wrote: > > The web module provides a very small amount of functionality that is pretty > easy to copy into your own application. I'd suggest

Re: Sharing models?

2023-01-21 Thread Andrus Adamchik
Hi Paul, You are right. If your models are in different Cayenne projects, they are only combined in runtime, and there's no easy way of creating relationships between them. And looks like you've already found the workarounds. I've had a case like yours, where I ended up creating those

Re: New user: Cayenne Modeler bug?

2023-01-13 Thread Andrus Adamchik
Hi Paul, Thanks for the detailed report. Yeah, EOModel importer due to its nature (people import their projects once, and then stay on Cayenne and never come back) has its share of issues. I just logged a Jira [1], but for now I recommend manually removing the failing qualifier from the source

Re: Cayenne and GraalVM

2023-01-12 Thread Andrus Adamchik
Possibly. Though ServiceLoader that does auto-loading is pretty standard Java API. > On Jan 12, 2023, at 9:11 PM, Michael Gentry wrote: > > Is that due to reflection? > > On Wed, Jan 11, 2023 at 8:09 AM Andrus Adamchik wrote: > >> And per the latest comments in tha

Re: Cayenne and GraalVM

2023-01-11 Thread Andrus Adamchik
ServerModule()) // ... .build(); Andrus > On Jan 10, 2023, at 9:57 AM, Andrus Adamchik wrote: > > FYI: https://github.com/oracle/graal/issues/5716 > > A discussion on how to package a Cayenne app to a native executable with > Graal. If anyone tried doing that b

Cayenne and GraalVM

2023-01-10 Thread Andrus Adamchik
FYI: https://github.com/oracle/graal/issues/5716 A discussion on how to package a Cayenne app to a native executable with Graal. If anyone tried doing that before and has some experience, feel free to chime in. Andrus

Re: Regression from 4.2-RC2 to 4.2-RC3

2022-12-14 Thread Andrus Adamchik
ould just safely rollback to 4.2.RC1, there are no major issues fixed > in RC2 (this one causing your troubles and the one about split path > expressions). > > On Wed, Dec 14, 2022 at 10:46 AM Andrus Adamchik wrote: >> >> Correct, we fixed an issue with two ident

Re: Regression from 4.2-RC2 to 4.2-RC3

2022-12-13 Thread Andrus Adamchik
Correct, we fixed an issue with two identical join table records being committed in certain cases with inheritance. I'll defer to Nikita to comment on the effects on your case. Andrus > On Dec 13, 2022, at 10:08 PM, Lon Varscsak wrote: > > My guess is the new logic in >

[ANN] Cayenne 4.2.RC2 release

2022-12-06 Thread Andrus Adamchik
The new release candidate of Cayenne 4.2 (4.2.RC2) is available. It has quite a few bug fixes in the Modeler and in the runtime, so we decided to have one more RC before a GA release. Also we marked as deprecated the modules that are going away in 5.0 to give an advance warning to the users

Re: Which to pick: Cayenne 4.2 vs. 5.0?

2022-11-21 Thread Andrus Adamchik
Exactly. There's lots of good stuff planned for 5.0, but it is not developed yet. So 4.2 is the best choice right now. It is both modern and stable. I also use it in prod everywhere. 4.2 is about to go GA once we figure out how fix some Modeler issues caused by the latest MacOS. Andrus >

Re: About ValueObjectType and Extended types and Collection based objects

2022-10-24 Thread Andrus Adamchik
Hi Riccardo, Indeed, ValueObjectType and ExtendedType are not generics-aware. Something we may need to think about and maybe add to Cayenne. What I would recommend in your situation is to map your attributes using custom lightweight wrapper types, one class per specific case. E.g.

Re: Any ROP users?

2022-10-04 Thread Andrus Adamchik
Hi Henrique, Good catch. I wonder if the serialization code causes these vulnerability warnings on its own though. Note that org.apache.cayenne.Persistent is declared as Serializable, and this you can't change via a custom template (at least not yet, see below). So maybe try removing those

Re: cdbimport ignores foreign key constrains with SQLite

2022-07-22 Thread Andrus Adamchik
> On Jul 22, 2022, at 3:56 PM, Ali Baharev wrote: > > FKs have been supported since at least 2009. It does have a well > documented quirk though: You must enable foreign key support > explicitly. > > 2. Enabling Foreign Key Support > https://www.sqlite.org/foreignkeys.html#fk_enable >

Re: cdbimport ignores foreign key constrains with SQLite

2022-07-22 Thread Andrus Adamchik
Last time I checked, SQLite driver didn't support FKs. But this was a long time ago, so who knows :) Derby would certainly support FKs, and the driver is pretty solid. Andrus > On Jul 22, 2022, at 3:24 PM, Ali Baharev wrote: > > Hi, > > I am trying to use cdbimport with the attached toy

Re: SelectQuery deprecation

2022-07-05 Thread Andrus Adamchik
> so it can be changed so it can be *chained* :) > On Jul 5, 2022, at 8:47 AM, Andrus Adamchik wrote: > > Hi Tore, > > Yeah, that's a big one to change. There's no script that I am aware of, and > writing a generic one would probably require to work with the Java synta

Re: SelectQuery deprecation

2022-07-05 Thread Andrus Adamchik
Hi Tore, Yeah, that's a big one to change. There's no script that I am aware of, and writing a generic one would probably require to work with the Java syntax AST. SelectQuery uses "Java Bean" style with "void" return type of most methods, while ObjectSelect returns "this" (so it can be

Re: Jetty container not starting

2022-07-04 Thread Andrus Adamchik
Hi Ali, Thanks for sharing what you do with Cayenne. Yes, a pull request on GitHub would be appreciated. Thanks, Andrus > On Jul 4, 2022, at 1:25 PM, Ali Baharev wrote: > > Dear Andrus, > >> I think that we simply need to >> remove the "Converting to Web Application" section, which is

Re: Jetty container not starting

2022-07-04 Thread Andrus Adamchik
Glad that you were able to find the solution. Honestly, there's so many flavors of environments these days, that I think that we simply need to remove the "Converting to Web Application" section, which is indeed dated. Andrus > On Jul 4, 2022, at 9:57 AM, Ali Baharev wrote: > > Adding: > >

Re: Missing Injector inconsistently

2022-06-24 Thread Andrus Adamchik
Hi Richard, I assume the exception happens within BaseContext.attachToRuntimeIfNeeded(). This whole business of attaching to runtime is a hack for auto-deserialization of the context in certain environments. Tomcat does HttpSession serialization for the purpose of session clustering (and

[ANN] Release 4.2.RC1

2022-06-13 Thread Andrus Adamchik
Glad to announce Cayenne 4.2 release candidate. It fixes a few remaining JDK 17 compatibility issues (Gradle, protostuff/ROP). Also a number of bug fixes. Very good chance the next 4.2 release will be "GA". Full list of bug fixes: CAY-2711 JDK 17 compatibility CAY-2728 Add ExtendedType to

Re: DI container has no binding for key

2022-03-29 Thread Andrus Adamchik
ANY > # KIND, either express or implied. See the License for the > # specific language governing permissions and limitations > # under the License. > ###### > > org.apache.cayenne.configuration.server.MainCayenneServerModuleProvider > > On Wed, Mar

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
;>> package >>>>> in there like this: >>>>> >>>>> [image: image.png] >>>>> >>>>> So, I build the project, grab the published JAR artifact and put the >>> file >>>>> in t

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
face for plugins, as I've come to understand). It's source code > should be here: > https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse . > > On Wed, Mar 23, 2022 at 4:33 PM Andrus Adamchik wrote: > >> The bootstrap code is as vanilla as it can get: >> &g

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
is code in ModuleLoader from returning proper resources: for (ModuleProvider provider : ServiceLoader.load(providerClass)) { ... } We need to understand how Spigot classpath works. Cursory Googling shows that this is a common problem, just don't immediately see a solution. Andrus > On Mar 23,

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
t-1.18.1-R0.1-SNAPSHOT.jar:3443-Spigot-699290c-2c1e499] >> at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:994) >> ~[spigot-1.18.1-R0.1-SNAPSHOT.jar:3443-Spigot-699290c-2c1e499] >>at >> net.minecraft.server.MinecraftServer.lambda$0(MinecraftServ

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
Hi Stefan, Could you include a full stack trace please? Thanks, Andrus > On Mar 23, 2022, at 1:04 AM, Stefan Stegic wrote: > > Hi, > > > First some context: I'm working on a custom Minecraft server (Spigot) > plugin. It's just a JAR that you export and place somewhere in the server's >

Re: Exception when setting a CLOB on H2 v2.0.202

2022-01-18 Thread Andrus Adamchik
Hi Nigel, Thanks for pointing this out. What you are suggesting sounds like the right solution. And we'd gladly accept a PR at https://github.com/apache/cayenne Cheers, Andrus > On Jan 19, 2022, at 4:38 AM, Nigel Huband wrote: > > Hi everybody, > > In

[ann] Cayenne 4.1.1 is released

2021-12-24 Thread Andrus Adamchik
We just posted a 4.1.1 maintenance release of Cayenne. It provides a few missing pieces related to Java 17 support (Modeler and Gradle), as well as a bunch of bug fixes. So if you are on 4.1, upgrade is highly recommended. Happy holidays, Andrus

[ANN] Cayenne 4.2 goes beta

2021-12-07 Thread Andrus Adamchik
Hi everyone, Happy to announce that Cayenne 4.2 just went Beta. The new 4.2.B1 release is available from the Cayenne website [1] and Maven Central. Since the last milestone we've implemented a couple of minor features and 19 bug fixes [2], the most notable being desktop Java 17 support for

Re: Performance with quoteSqlIdentifiers

2021-11-23 Thread Andrus Adamchik
Hi Andrew, DataMaps don't work as "layers" on top of each other, so the answer to #2 is no. For #1, I am not aware of any visible performance impact of quoting identifiers. So you can just use quoted identifiers everywhere. Andrus > On Nov 23, 2021, at 5:16 PM, Meeks, Andrew wrote: > >

Re: Questions about the modeler

2021-11-21 Thread Andrus Adamchik
Hi Tony, We do not generate this SQL. Schema retrieval is abstracted by the JDBC API, so specifics are hidden within a given driver. All we do is this: DatabaseMetaData md = connection.getMetadata(); md.getTables(..); md.getColumns(..); md.getImportedKeys(..); Andrus > On Nov 22,

Re: Problem with optional to-one deletion

2021-11-17 Thread Andrus Adamchik
Hi Mike, Nikita mentioned a few hours ago that he was able to reproduce. Appears to be a bug in the 4.2 stack. Andrus > On Nov 17, 2021, at 7:44 PM, Michael Gentry wrote: > > Hi Lon, > > I didn't have a lot of time to look into it, but I suspect it may be in > your PK/FK mapping on the

Re: Modeler Types

2021-11-05 Thread Andrus Adamchik
Hi Tony, Support for non-standard SQL types was added in 4.2: https://lists.apache.org/thread/66nhvkzt1mqoh2h53h2x6sbx968kt2fy We are mapping those types on the DB side as JDBC type OTHER. On the Java type it is mapped as org.apache.cayenne.value.Json. Andrus > On Nov 4, 2021, at 6:34 PM,

Re: Ordering objects by primary keys

2021-10-28 Thread Andrus Adamchik
Yeah, the expressions chapter mentions it: http://cayenne.apache.org/docs/4.1/cayenne-guide/#expressions Andrus > On Oct 28, 2021, at 9:38 AM, giulio.ces...@gmail.com wrote: > > Is there any point in the documentation where

Re: Always getting distinct results in fetch?

2021-10-21 Thread Andrus Adamchik
/access/DataDomainQueryAction.java#L816 > > On Wed, Oct 20, 2021 at 8:28 AM Andrus Adamchik wrote: >> >> Yeah, this seems wrong. "Historically" distinct would be implicitly added >> (either to SQL or to the processed result) when a query condition contained >> to

Re: Always getting distinct results in fetch?

2021-10-19 Thread Andrus Adamchik
Yeah, this seems wrong. "Historically" distinct would be implicitly added (either to SQL or to the processed result) when a query condition contained to-many relationships. The goal was to preserve the abstraction of an "object" query, and return the same consistent result regardless of the SQL

CayenneModeler on Java 17

2021-09-27 Thread Andrus Adamchik
Hi folks, Wanted to mention that there's a known issue with CayenneModeler (all versions) and Java 17. We created a Jira [1] and will be working on a fix. Luckily there are workarounds (also described in the Jira) : * You can use cross-platform Modeler * On Mac you can launch the "native" Mac

Re: Cayenne Version 4.0 Logging

2021-09-08 Thread Andrus Adamchik
Hi Keena, You are using DBCP2 DataSource [1] in your app, specifically an instance of BasicDataSource [2]. I haven't used it myself, but quick code/javadocs inspection shows it has methods like "getNumActive()", etc. that should allow you to check its state at any moment in time. Also it can

Re: Suggested modeler change...

2021-07-16 Thread Andrus Adamchik
Yeah, the whole PK generation abstraction is somewhat leaky. It works, but is challenging to apply consistently across different DB engines and different generator strategies. And as a result is challenging to present to the end user in a sane fashion. Just recently had this discussion with

Re: Examples of Cayenne Tapestry apps

2021-05-12 Thread Andrus Adamchik
> > On May 12, 2021, at 1:50 PM, D Tim Cummings > wrote: > > Does anyone know of any good open-source Cayenne Tapestry apps that show > best practice and latest features for using these two frameworks > together? Most of the Tapestry examples use Hibernate. > > Tim Hi Tim, Not aware of any

Re: Modeler Question....

2021-04-30 Thread Andrus Adamchik
Hi Tony, Yeah I remember how slow Oracle tests always were due to the schema operations. And I've also observed your problem even on databases with much faster metadata retrieval. So I agree that DB import process should attempt to apply DB-side metadata filtering to the maximum extent

Re: Configuring multiple DataNodes

2021-04-23 Thread Andrus Adamchik
also per-node connection params can be passed as properties: https://cayenne.apache.org/docs/4.1/cayenne-guide/#appendix-a-configuration-properties > On Apr 23, 2021, at 10:58 AM, John Huss wrote: > >

Re: Cayenne-Generated PK (NULL not allowed for column "ID")

2021-04-23 Thread Andrus Adamchik
); Andrus > On Mar 30, 2021, at 7:56 AM, Gilberto Caetano de Andrade > wrote: > > > > On 2021/03/30 06:10:45, Andrus Adamchik wrote: >> Yeah, schema handling for PK support objects is limited. So you adding it >> manually to the script was a good idea. >

Re: PK Generation and FrontBase

2021-04-20 Thread Andrus Adamchik
> On Apr 20, 2021, at 7:40 AM, Jérémy DE ROYER > wrote: > > I remember this library at Frankfurt but I though it was mainly for > statistics purposes. For me it has become a "Swiss Army knife" for any kind of data manipulation. It treats data as, well "data", not imposing any other

Re: PK Generation and FrontBase

2021-04-20 Thread Andrus Adamchik
connector.saver.TableSaveStrategy.save(TableSaveStrategy.java:36) > at com.nhl.dflib.jdbc.connector.TableSaver.save(TableSaver.java:89) > at > your.app.SellAndPepperDatabaseMigration.main(SellAndPepperDatabaseMigration.java:78) > > > FBJInputStream.read() > == > > public i

Re: PK Generation and FrontBase

2021-04-19 Thread Andrus Adamchik
.StatementBuilder.update(StatementBuilder.java:108) > ... 9 more > Caused by: java.sql.SQLException > at com.frontbase.jdbc.FBJConnection.readLOB(Unknown Source) > at com.frontbase.jdbc.FBJClob.getSubString(Unknown Source) > at > org.postgresql.jdbc.PgPreparedStatement.asString(PgPreparedStatement.java:73

Re: PK Generation and FrontBase

2021-04-19 Thread Andrus Adamchik
LinkMove will definitely work, but is targeting ongoing DB synchronization instead of a one-off migration. I would personally deal with it in a more low-tech way. Since you only need to do it once, the simplest tool is the best. I would use DFLib library [1] to read data from one DB and write

Re: CayenneModeler crash

2021-04-19 Thread Andrus Adamchik
Hmm.. Don't have an M1 to test. Also weird that there's a difference between command line and GUI launch. Andrus > On Apr 19, 2021, at 2:31 AM, Lon Varscsak wrote: > > Hey all, > > For some reason the recent version of CayenneModeler (4.2.M4-SNAPSHOT) > crashes on launch. The only thing I

Re: Cayenne-Generated PK (NULL not allowed for column "ID")

2021-03-30 Thread Andrus Adamchik
Yeah, schema handling for PK support objects is limited. So you adding it manually to the script was a good idea. >> I choose JdbcAdapter because I want the Cayenne-Generated PK option From the exception stack trace, your DB is "h2", so try using the H2 Adapter

[ANN] Cayenne 4.2.M3 released

2021-03-23 Thread Andrus Adamchik
I am glad to announce a release of Cayenne 4.2.M3. The release is stabilizing, so there are only a few new features. A notable one is support for annotated callback methods on entity classes (mapping those in the Modeler is annoying). Though we are still working out the performance aspects of

Re: cdbimport for SQLite

2021-02-07 Thread Andrus Adamchik
Hi Maria, CAY-2600 is a related, but separate issue. Here is the one that matches your problem: https://issues.apache.org/jira/browse/CAY-2695 . I just updated it with your description. I hope we can fix this specific problem as I mentioned in

Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Andrus Adamchik
cgen2 > > > ${project.basedir}/src/main/resources/mapB.map.xml > > > cgen > > > > > > ... > > > Thanks f

Re: cayenne-maven-plugin and its executions environment

2021-02-03 Thread Andrus Adamchik
ormation is missing. Maybe that why the mentioned error "The > parameters 'map' for goal > org.apache.cayenne.plugins:cayenne-maven-plugin:4.2.M2:cgen are missing or > invalid" occurs. > Is there any Maven settings to change this import behavior? > > Kind regards, Maria > > >

Re: SQLTemplate date types

2021-02-02 Thread Andrus Adamchik
Not currently, but I think we must implement it in some way. I can't imagine anyone still wanting to deal with java.sql.Timestamp. Andrus > On Feb 3, 2021, at 9:04 AM, Lon Varscsak wrote: > > Is there any way to change the default date types that get returned by > SQLTemplate queries to use

Re: cayenne-maven-plugin and its executions environment

2021-02-01 Thread Andrus Adamchik
Kind regards, > Maria > > > On 2021/02/01 05:53:27, Andrus Adamchik wrote: >> Hi Maria,> >> >> This may be just a typo in your POM:> >> >>> ${project.basedir}/src/main/resources/scenario/my.map.xml> >> >> vs> >> >

Re: Spatialite Integration in Cayenne

2021-01-26 Thread Andrus Adamchik
just as a plain text >> string. >> Next an example insert query (SRID = 4236) that should work: >> >> "INSERT INTO tabname (geom) VALUES (GeomFromText (?,4236))"; >> "INSERT INTO tabname (geom) VALUES (GeomFromText (?, ?),4236)" >> >>

Re: Storing a column containing a JSON-object before save

2021-01-04 Thread Andrus Adamchik
Hi Hugi, FWIW, we are in the process of solving this exact problem of detecting changes in a complex value object for Cayenne's own JSON type available since 4.2: https://github.com/apache/cayenne/pull/443 In our case we had to do something even

Re: use Date values in ExpressionFactory.exp

2021-01-02 Thread Andrus Adamchik
> On Jan 2, 2021, at 3:45 PM, Mike Kienenberger wrote: > > Date date = new GregorianCalendar(2003, Calendar.JULY,17).getTime() ; > Expression matchDateGreaterThanDate1 = > ExpressionFactory.greaterExp("MODIFIED_DATE", date); As Mike said, the above should work, but if you are building an

Re: Bug in DataRowsUtils

2020-11-20 Thread Andrus Adamchik
Case-sensitivity and default case conversions of DB names depend on the type of DB and even on DB configuration, making any assumptions highly unreliable. The solution to this issue between case interpretation between Cayenne model and DB is to use quotations. around identifiers Quotations make

Re: ObjectSelect to select uncommitted objects

2020-11-17 Thread Andrus Adamchik
FWIW, there were requests for this functionality previously, but it was hard to achieve full feature parity between in-memory and DB evaluation, so we didn't do it yet. Perhaps we should do it incrementally over time, addressing various edge cases as we uncover them. Andrus > On Nov 16,

Re: When 4.2.M3 will be avaiabøe?

2020-11-13 Thread Andrus Adamchik
Hopefully soon. A few more things to finish before the release. > On Nov 13, 2020, at 11:26 AM, Andrea Biasillo wrote: > > Hi! > > When 4.2.M3 will be available? I really need this: > > https://issues.apache.org/jira/browse/CAY-2683?jql=project%20%3D%20CAY%20AND%20text%20~%20%22distinct%22

Re: about mysql support

2020-11-11 Thread Andrus Adamchik
I second that. MySQL 8 is supported. I am only aware of one issue specific to MySQL 8 driver: timezone offset handling. It is similar to this: https://github.com/nhl/dflib/issues/113 . And it actually works in Cayenne, just that the data stored in DB is incompatible with the earlier versions

Re: Issue java.io.StreamCorruptedException

2020-11-03 Thread Andrus Adamchik
Hi there, I suspect this has nothing to do with CLOB and String. It may be other attributes. So a few questions: 1. What version of Cayenne is this? 2. Do you have a longer stack trace? 3. Could you check the logs preceding the exception for messages like "Haven't found suitable ExtendedType

Re: Spinning up Cayenne in a unit test.

2020-10-29 Thread Andrus Adamchik
the objects. > Because it's included in a bootique app, we can't use Bootique to do the > testing here. It needs to be just Cayenne. So any ideas about what might be > going wrong here? > > > Tony > > On Thu, Oct 29, 2020 at 1:56 AM Andrus Adamchik > wrote: > >> A

Re: Spinning up Cayenne in a unit test.

2020-10-28 Thread Andrus Adamchik
datatsets preparation and data assertions Andrus > On Oct 29, 2020, at 8:48 AM, Andrus Adamchik wrote: > > You can still start a BQRuntime in tests, even if the module doesn't use > Bootique. Then you'd define a DataSource within BQRuntime, and > "bootique-cay

Re: Spinning up Cayenne in a unit test.

2020-10-28 Thread Andrus Adamchik
You can still start a BQRuntime in tests, even if the module doesn't use Bootique. Then you'd define a DataSource within BQRuntime, and "bootique-cayenne" would create a DataNode for it automatically and transparently. YMMV with older Bootique versions. E.g. Agrest (that has no Bootique

Re: Issue with FrontBase PK generation in Cayenne 4.1

2020-10-18 Thread Andrus Adamchik
Yes, SQLTemplate is processed via a different JDBC call in 4.1. > On Oct 18, 2020, at 7:57 PM, Amedeo Mantica > wrote: > > btw I have no issues using Cayenne 4.0.2, the issue happens only in 4.1 > >> On 18 Oct 2020, at 09:36, Andrus Adamchik wrote: >> >> Hi

Re: Issue with FrontBase PK generation in Cayenne 4.1

2020-10-18 Thread Andrus Adamchik
Hi Amedeo, You hit this issue: https://issues.apache.org/jira/browse/CAY-2574 . This is a bug in FrontBase driver. We started a conversation with FrontBase folks a year and a half ago, and even made some progress. But it died down and we are

Re: Resetting an object back to committed state (including relationships)

2020-10-18 Thread Andrus Adamchik
"invalidateObjects" should invalidate relationships too. IIRC this worked exactly as you'd expect in a root context. I don't use nested contexts. Wonder if a bug crept in there? Andrus > On Oct 18, 2020, at 2:53 AM, Lon Varscsak wrote: > > I have a situation where I need to invalidate an

Re: [ANN] Cayenne 4.2.M2 release

2020-10-13 Thread Andrus Adamchik
s there an example or doc for the support of JSON types? >> >> regards >> Meex >> >> Am Di., 13. Okt. 2020 um 08:48 Uhr schrieb Andrus Adamchik < >> and...@objectstyle.org>: >> >>> 4.2.M2 release is out [1]. A few cool things in this

Re: [ANN] Cayenne 4.2.M2 release

2020-10-13 Thread Andrus Adamchik
st tell me  > > Many thank's > > Jérémy > >> Le 13 oct. 2020 à 08:48, Andrus Adamchik a écrit : >> >> 4.2.M2 release is out [1]. A few cool things in this release: >> >> * Support for JSON and geospatial value types. >> * Ordering on aggregate func

[ANN] Cayenne 4.2.M2 release

2020-10-13 Thread Andrus Adamchik
4.2.M2 release is out [1]. A few cool things in this release: * Support for JSON and geospatial value types. * Ordering on aggregate functions and in-memory evaluation of aggregate expressions. * Modeler support for downloading JDBC drivers from maven central. * Runtime changes that may be less

Re: Cayenne 4.2—Modifying SQL generation to always use COALESCE when updating a certain column

2020-09-11 Thread Andrus Adamchik
4.2 for the first time exposes generated SQL as an AST, so tweaking it has become much easier. This is the feature that made possible to support geospatial and JSON types. Nikita, please correct me if I am wrong with the following instructions (as this API is still in flux). So.. To customize

Re: DomainStoppedException: Domain project was shutdown...

2020-09-08 Thread Andrus Adamchik
Hi, This indicates that Cayenne was accessed after the stack shutdown. The only place that may happen in Bootique is when the entire app is stopped and ShutdownManager is called [1]. Also this should be an unrecoverable error, so after you see it once, all subsequent Cayenne operations would

Re: VARCHAR vs LONGVARCHAR vs CLOB

2020-09-08 Thread Andrus Adamchik
> should I just define everything as VARCHAR and forget about it? Yes. CLOBs have some special handling, which is irrelevant for Postgres. > On Sep 7, 2020, at 5:43 PM, Hugi Thordarson wrote: > > Hi all, > while looking further into migration to 4.2 I noticed my model has several >

Re: Programmatically adding (db/obj) attributes to a model and saving

2020-09-08 Thread Andrus Adamchik
Yeah, that's as good as it gets. ProjectLoader/Saver deal with multi-file projects. If you need to modidy a single existing DataMap, XMLEncoder is what you need. Andrus > On Sep 6, 2020, at 12:25 PM, Hugi Thordarson wrote: > > Well that's no fun when you have this nice purpose-build API

Re: SQLSelect and Prefetching (cayenne 4.1)

2020-07-30 Thread Andrus Adamchik
update the docs. Andrus > On Jul 30, 2020, at 9:11 AM, Andrus Adamchik wrote: > > Hi, > > We may need to make it more obvious in the API, but SQLSelect only supports > JOINT prefetching [1]. It can't support disjoint, as Cayenne has no way of > building the right WHERE c

Re: SQLSelect and Prefetching (cayenne 4.1)

2020-07-30 Thread Andrus Adamchik
Hi, We may need to make it more obvious in the API, but SQLSelect only supports JOINT prefetching [1]. It can't support disjoint, as Cayenne has no way of building the right WHERE clause for prefetch queries. It can theoretically support DISJOINT_BY_ID, but IIRC it does not. So let's focus

Re: springboot and cayenne

2020-07-29 Thread Andrus Adamchik
Hi Tony, I haven't used Cayenne with SpringBoot for obvious reasons, but it should be no different from using it in any other env: * Create a ServerRuntime singleton * Get ObjectContext from it when you need it. Andrus > On Jul 29, 2020, at 5:33 PM, Tony Giaccone wrote: > > I see there's a

Re: [ANN] Cayenne 4.1 goes final

2020-07-27 Thread Andrus Adamchik
Here it is: https://search.maven.org/artifact/org.apache.cayenne/cayenne-server/4.1/jar > On Jul 27, 2020, at 4:21 PM, Andrew Willerding > wrote: > > This is great news! Hmmm. I can't seem to find it on Maven central yet. > > On 2020-07-24 1:52 a.m., Andrus Adamchik wrot

[ANN] Cayenne 4.1 goes final

2020-07-23 Thread Andrus Adamchik
Very excited to announce the final / GA release of Apache Cayenne 4.1! It is available on Maven central and as a download on cayenne.apache.org. For the 4.0 users this is an exciting upgrade, offering an immediate and tangible performance boost (field-based data objects) and a new easy

Re: [OT] I demand change

2020-07-13 Thread Andrus Adamchik
Haha... I think "download Cayenne" is the only search that doesn't offer me a Porsche picture :) Andrus > On Jul 13, 2020, at 12:16 PM, Hugi Thordarson wrote: > > That's it. I'm sick and tired of Porsche polluting my search results. > > http://chng.it/ySkvT5DK7z >

Re: Automatically deleting objects from a to-many relationship when removed?

2020-07-13 Thread Andrus Adamchik
Hi Faizel, The answer is no. Unsetting a relationship will never delete its target object. So you'll need to do it explicitly. There are "delete rules" for relationships, but those require the source object to be deleted to trigger nullify/cascade/deny action. So that's different. Andrus >

Re: Apache Cayenne ROP - Error Connect

2020-07-04 Thread Andrus Adamchik
Hi Dayvyd, Which version of Cayenne is this and how is the server setup? Andrus > On Jul 2, 2020, at 12:20 AM, Dayvyd . wrote: > > Hi, > > Has anyone encountered this error when running Main.java using BASIC > authentication? Without authentication it works normally! > > Error:

Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
ntLogger] (ServerService Thread Pool -- 87) > Detected and installed adapter: com.dataloy.platform.DataloyOracleAdapter > > Also another thing is the the method setJdbcObject is invoked, but not > materializeObject > > Regards, > Andrea > > On 2020/06/29 08:35:05,

Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
oked. > > Regards, > Andrea > > On 2020/06/29 08:19:15, Andrus Adamchik wrote: >> Hi Andrea, >> >> "materializeObject" method should still be called of course. When >> registering custom types within the adapter, I'd usually override >> "conf

Re: problem with ExtendedType in Cayenne 4.2

2020-06-29 Thread Andrus Adamchik
Hi Andrea, "materializeObject" method should still be called of course. When registering custom types within the adapter, I'd usually override "configureExtendedTypes": @Override protected void configureExtendedTypes(ExtendedTypeMap map) { super.configureExtendedTypes(map);

  1   2   3   4   5   6   7   8   9   10   >