Re: FaultFailureException

2024-11-15 Thread Andrus Adamchik
objects and I don't want > that a commit in the global context affects the local object. > > Meex > > Am Do., 14. Nov. 2024 um 20:21 Uhr schrieb Andrus Adamchik < > aadamc...@gmail.com>: > >> Looking at the code, it appears that "localObject(..)" beh

Re: FaultFailureException

2024-11-14 Thread Andrus Adamchik
is moved to a new local Context > > the error occurs then when trying to the readProperty id > > public String getId() { > > beforePropertyRead("id"); > > return this.id; > > } > > > id is defined as primary key and mandatory > >

Re: FaultFailureException

2024-11-14 Thread Andrus Adamchik
FaultFailureExceptions are usually caused by referential integrity problems in DB. But this one is unusual as it references a TEMP ID (i.e. an uncommitted object). I don't think I've seen this flavor. Can you provide some more context around the error. I.e. what code leads to this. Andrus > O

Re: Log4j2

2024-11-13 Thread Andrus Adamchik
AM, Markus Reich wrote: > > Hi, I'm using 4.2.1 > > Am Mi., 13. Nov. 2024 um 12:35 Uhr schrieb Andrus Adamchik < > aadamc...@gmail.com>: > >> Happy to hear you found a solution. So which version of Cayenne are you on? >> >>> On Nov 13, 2024, a

Re: Log4j2

2024-11-13 Thread Andrus Adamchik
t; slf4j-api > > ${slf4j.version} > > > > > > > org.slf4j > > slf4j-reload4j > > ${slf4j.version} > > > > > > > org.slf4j > > jul-to-slf4j > > ${slf4j.version} > > > > the logs were written >

Re: Log4j2

2024-11-12 Thread Andrus Adamchik
Hi Markus, > In all latest Cayenne versions (starting with 3.1), the name of the logger should be "org.apache.cayenne.log.JdbcEventLogger". Thanks, Andrus > On Nov 12, 2024, at 1:20 AM, Markus Reich wrote: > > Hi, > > I switched from log4j properties file configuration to log4j2 xml > con

Re: Cayenne 5.0-M1 is out

2024-09-29 Thread Andrus Adamchik
help during a process like this so thanks for > that. > > I'll do a more detailed writeup at some point. But in short; 5.0 is really > making me all re-excited about Cayenne. Thanks for all the work you're doing > and again, congrats! > > - hugi > > &

Cayenne 5.0-M1 is out

2024-09-27 Thread Andrus Adamchik
A belated, but nonetheless exciting announcement. Our team recently released the first milestone of Cayenne 5.0. There are more than a hundred Jiras in the release notes, so it is easy to get lost 🙃 But the main direction is simplifying the structure of the framework, now that we removed the pr

Re: Migrating from EOF → Cayenne: partial entities

2024-09-02 Thread Andrus Adamchik
he.org/docs/4.2/cayenne-guide/#merging-multiple-projects [2] https://github.com/apache/cayenne/blob/master/cayenne/src/main/java/org/apache/cayenne/configuration/DataChannelDescriptorMerger.java > On Sep 1, 2024, at 7:06 PM, Paul Hoadley wrote: > > Hi Andrus, > > On 1 Sep 2024, at

Re: Migrating from EOF → Cayenne: partial entities

2024-09-01 Thread Andrus Adamchik
Hi Paul, So partial entities are essentially ORM model "mixins". A neat idea, but unfortunately not supported by Cayenne. So you'd need to recreate the contents of each partial entity insider every concrete entity. Andrus > On Aug 31, 2024, at 9:51 PM, Paul Hoadley wrote: > > Hello, > > As

Re: UUIDs

2024-08-26 Thread Andrus Adamchik
to Cayenne. A. > On Aug 26, 2024, at 9:30 AM, Andrus Adamchik wrote: > > Yep. The IDUtil-returned sequence is not an RFC-compliant UUID. It is kind of > our own invention. We can change it to a formal UUID. Though Java still > doesn't support UUIDv7, which is bummer. Wond

Re: UUIDs

2024-08-26 Thread Andrus Adamchik
> generator class. Nothing currently stops you from manually setting a UUID >> yourself, but including support in the modeler would be a more natural fit, >> I think. >> >> Thanks, >> mrg >> >> >> On Fri, Aug 23, 2024 at 4:33 PM Andrus Adamchik w

Re: UUIDs

2024-08-24 Thread Andrus Adamchik
g support in the modeler would be a more natural fit, > I think. > > Thanks, > mrg > > > On Fri, Aug 23, 2024 at 4:33 PM Andrus Adamchik wrote: > >> I am actually glad we went on a tangent and started discussing UUIDs. I >> just ran into a use-case of an idempot

UUIDs

2024-08-23 Thread Andrus Adamchik
gt;> >>>>>>> >>>>>>>> On 12 Aug 2024, at 13:52, Nikita Timofeev >>> >>>>>>> wrote: >>>>>>>> >>>>>>>> Hi Hugi, >>>>>>>> >>>>

Re: Cycles found on save in 4.2.1

2024-08-08 Thread Andrus Adamchik
Hi Maik, Could you provide an example of a failing graph? Thanks, Andrus > On Aug 7, 2024, at 7:31 AM, Maik Musall wrote: > > Hi everyone, > > we upgraded an application from Cayenne 4.1.1 to 4.2.1, and now we’re getting > more cyclic graph errors from AshwoodEntitySorter. Years back we alre

Re: @size in ObjectSelect.orderBy()

2024-07-27 Thread Andrus Adamchik
OF but I must say Cayenne is very gratifying. Working in a > modern IDE with a compact ORM is such a pleasure. I just need to find my way > on how things are done in this different world. I guess I’ll need to sort > in-memory. Or maybe put something on the db side. Thank you anyway. >

Re: @size in ObjectSelect.orderBy()

2024-07-27 Thread Andrus Adamchik
No. Unlike EOF, "@size" is not a keyword with any meaning in Cayenne. Andrus > On Jul 27, 2024, at 2:38 PM, Riccardo De Menna wrote: > > Can I use the @size keyword to sort a ToMany relationship in the backend with > ObjectSelect.orderBy() ? > > I’m getting: > > java.lang.IllegalStateExceptio

[ANN] Release 4.2.1

2024-06-29 Thread Andrus Adamchik
Happy to announce the recent maintenance release of Cayenne 4.2.1. It primarily about bug fixes: expressions, vertical inheritance, etc. Full release notes: Changes/New Features: CAY-2849 Switch documentation to `hugo-asciidoctorj-extension` CAY-2852 Update velocity-engine-core dependency CAY-28

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 3:

Re: How to use a custom aggregate function?

2024-01-05 Thread Andrus Adamchik
r.nextRow(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.runQue

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 ASTAggregat

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 attend?

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 ha

[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 3

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 g

Re: Graal (Native Image) with Cayenne

2023-04-05 Thread Andrus Adamchik
upplied 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, A

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 an

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" q

[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 loo

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 relations

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
you > could 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

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 > DefaultDataDomainFlu

[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 (ROP

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 > On

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. CommaSepara

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 gene

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 SQLi

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

Re: SelectQuery deprecation

2022-07-04 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 changed

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 indeed

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 addres

[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 gener

Re: DI container has no binding for key

2022-03-29 Thread Andrus Adamchik
CONDITIONS OF 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 > &g

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
I did was specify which dependencies I want to >>> package >>>>> in there like this: >>>>> >>>>> [image: image.png] >>>>> >>>>> So, I build the project, grab the published JAR artifact and put the >>> fil

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
while Bukkit is > the interface 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 i

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
revents this 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

Re: DI container has no binding for key

2022-03-23 Thread Andrus Adamchik
spigot-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(Minecraf

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 > folde

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 C

[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 Cay

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: > > Hell

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, 2021

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 DbEnt

Re: Modeler Types

2021-11-04 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, To

Re: Ordering objects by primary keys

2021-10-27 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 thi

Re: Always getting distinct results in fetch?

2021-10-20 Thread Andrus Adamchik
cess/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 >&g

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 M

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 b

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 Niki

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 o

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 possible

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: > > W

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 abstrac

Re: PK Generation and FrontBase

2021-04-20 Thread Andrus Adamchik
flib.jdbc.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() > == > >

Re: PK Generation and FrontBase

2021-04-19 Thread Andrus Adamchik
mentBuilder.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:738) &g

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 to

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 di

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

2021-03-29 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 (org.apache.cayenne.dba.h2.H2Adap

[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 th

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
> > So the map information 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? > > Ki

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 ja

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: cayenne-maven-plugin and its executions environment

2021-01-31 Thread Andrus Adamchik
Hi Maria, This may be just a typo in your POM: > ${project.basedir}/src/main/resources/scenario/my.map.xml vs > ${project.basedir}/src/main/resources/my.map.xml ("scenario" folder is missing in the last case) As an aside, since 4.1 CayenneModeler started to save your class generation setti

Re: Spatialite Integration in Cayenne

2021-01-26 Thread Andrus Adamchik
rresponding argument 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)&q

Re: Spatialite Integration in Cayenne

2021-01-23 Thread Andrus Adamchik
Hi Inayah, As you noticed, spatial features are still new in Cayenne, and we will need to fill more than a few gaps. So thanks for your feedback. This will help us to prioritize our effort in this area. > WKT wrapper were added to the MySQLTreeProcessor and PostgreSQLTreeProcessor. > Both Proc

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 wor

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 expres

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, 2020,

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

2020-11-13 Thread Andrus Adamchik
; Thanks Andrus! > > With 4.2 M2 is not possible remove DISTICT from queries generated by > ObjectSelect, correct? > > Regards, > Andrea > > > On 2020/11/13 10:22:35, Andrus Adamchik wrote: >> Hopefully soon. A few more things to finish before the release.

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 of

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 f

Re: Spinning up Cayenne in a unit test.

2020-10-29 Thread Andrus Adamchik
odel and some basic services on 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

Re: Spinning up Cayenne in a unit test.

2020-10-28 Thread Andrus Adamchik
for 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 > "b

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 depende

  1   2   3   4   5   6   7   8   9   10   >