Re: cayenne-project.yaml

2025-10-02 Thread Michael Gentry
://www.youtube.com/watch?v=541sJUboCDE > > - hugi > > > > > On 2 Oct 2025, at 14:02, Michael Gentry wrote: > > > > ChatGPT be smokin' > > > > On Wed, Oct 1, 2025 at 10:37 PM Ricardo Parada > > wrote: > > > >> > >>

Re: cayenne-project.yaml

2025-10-02 Thread Michael Gentry
ChatGPT be smokin' On Wed, Oct 1, 2025 at 10:37 PM Ricardo Parada wrote: > > Is it true that Cayenne 5.0-M1 support .yml or .yaml for configuration and > that it’s the preferred format going forward? > > Or is ChatGPT hallucinating again? > > :-) > > Thanks > Ricardo

Re: Help upgrading 3.0.2 code to 4.2.2

2025-10-01 Thread Michael Gentry
Hi Giulio, In 4.2, you get the ObjectContext from the Cayenne Runtime: https://cayenne.apache.org/docs/4.2/getting-started-guide/#getting-started-with-objectcontext mrg On Wed, Oct 1, 2025 at 5:23 AM giulio.ces...@gmail.com < giulio.ces...@gmail.com> wrote: > Hello, > I have been able to fix a

Re: Cayenne-velocity depends on vulnerable velocity component

2025-06-25 Thread Michael Gentry
Hi Kelly, For now, can you try overriding the velocity version in your project's pom.xml? Maven will use the version you specify instead of the one Cayenne specifies as a dependency. Assuming Velocity 2.4 is largely compatible with 2.3, there shouldn't be any issues with this approach. Thanks, mr

Re: possible to change the name of the auto_pk_support table?

2025-05-05 Thread Michael Gentry
Opened a PR for this issue (CAY-2889). FWIW, Jira wouldn't allow me to assign the issue to myself. On Fri, May 2, 2025 at 2:06 PM Michael Gentry wrote: > Hi Robert! > > You are correct that it should've called the methods in your class. I'll > open a JIRA for the MyS

Re: possible to change the name of the auto_pk_support table?

2025-05-02 Thread Michael Gentry
2, 2025 at 10:29 AM Robert A. Decker wrote: > I'll try that next. It seemed logical to be able to just override those > methods in a subclass. But next, I'll copy/refactor the base class. I > didn't look at the cayenne source code - was hoping to avoid that. > > Rob &g

Re: possible to change the name of the auto_pk_support table?

2025-05-02 Thread Michael Gentry
Hi Robert, I'm assuming you copied MySQLPkGenerator.java to a new PK Generator class and made changes. MySQLPkGenerator::getLongPrimaryKey calls super.pkSelectString(entityName) and super.pkUpdateString(entityName), which are located in JdbcPkGenerator. If you didn't remove the 'super' calls in y

Re: Is there a way to use EnumSet as custom data type?

2025-04-10 Thread Michael Gentry
Yeah, I think that's the way to go. It is what I used for the extended enum functionality: https://github.com/apache/cayenne/blob/master/cayenne/src/main/java/org/apache/cayenne/access/types/ExtendedEnumType.java On Mon, Apr 7, 2025 at 11:59 AM Nikita Timofeev wrote: > Hello Riccardo, > > It

Re: Cayenne 5.0-M1 is out

2024-09-28 Thread Michael Gentry
We aren't Spring/Boot! 😈 On Sat, Sep 28, 2024 at 12:17 PM Lon Varscsak wrote: > You should force at least 17 😈 > > On Sep 27, 2024 at 2:23:02 PM, Andrus Adamchik > wrote: > > > A belated, but nonetheless exciting announcement. Our team recently > > released the first milestone of Cayenne 5.0.

Re: UUIDs

2024-08-23 Thread Michael Gentry
ok. > > > > Unfortunately h2 doesn't appear to support deferred constraints, but I > tested this against postgres with the constraints present. > > > > Anyway, pardon this tangent, born from a joke. I won't really say this > really demonstrates much, but it was at le

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Michael Gentry
bles upon this thread > and suddenly decides to generate DB structures with UUID keys for the > coming hordes of ChatGPT-powered programmers :). > > Cheers, > - hugi > > > > On 16 Aug 2024, at 14:20, Michael Gentry wrote: > > > > Hi Hugi, > > > >

Re: Cycles found on save in 4.2.1

2024-08-16 Thread Michael Gentry
Hi Hugi, >From what I've read, UUID PKs have poor index performance and take up more storage. Wouldn't it be better to use an integer sequence like PostgreSQL and Oracle support? You can generate your PKs up front and Cayenne already knows how to deal with them. Thanks, mrg On Thu, Aug 15, 202

Re: Question about optionality in one-to-one relationships

2024-01-10 Thread Michael Gentry
Hi Riccardo, There is also a validateForSave() that might be easier (handles inserts and updates). mrg On Wed, Jan 10, 2024 at 8:34 AM Michael Gentry wrote: > Hi Riccardo, > > The To Dep PK checkbox on the DbEntity isn't really intended to say "this > relationship is r

Re: Question about optionality in one-to-one relationships

2024-01-10 Thread Michael Gentry
> >> > $requiredRelationships.add("${stringUtils.capitalizedAsConstant($rel.Name)}_PROPERTY")) > >> #end > >> #end > >> public static final List REQUIRED_RELATIONSHIPS = List.of( > >> #foreach( $rel in ${requiredRelationships} ) > >>

Re: Question about optionality in one-to-one relationships

2024-01-10 Thread Michael Gentry
NSHIPS = List.of( > #foreach( $rel in ${requiredRelationships} ) > ${rel}#if(!$foreach.last),#end > #end > ); > > And contrary to what I would expect, I get this in my superclass: > > public static final List REQUIRED_RELATIONSHIPS = List.of( > TO_SHIP_PROPERTY

Re: Question about optionality in one-to-one relationships

2024-01-09 Thread Michael Gentry
Hi Riccardo, I may have completely misunderstood your intention, but here is my first cut for a model: cayenne-o2o.xml: http://cayenne.apache.org/schema/10/domain"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://cayenne.apache.org/schema/10/domain https://cayen

Re: Cayenne and GraalVM

2023-01-12 Thread Michael Gentry
Is that due to reflection? On Wed, Jan 11, 2023 at 8:09 AM Andrus Adamchik wrote: > And per the latest comments in that task, Cayenne actually works with > Graal, just not the module auto-loading part: > > ServerRuntime.builder() > > // no autoloading, each module will need to be explicitly ad

Re: Using Cayenne without Maven

2022-07-21 Thread Michael Gentry
Hi Ali, What tooling are you using? Cayenne should be looking for that file at the root/top of one of the classpaths. Maven will package src/main/resource up and make it available at the root, but you can specify other classpath values yourself. Like if you are using a barebones java command, try

Re: DI container has no binding for key

2022-03-23 Thread Michael Gentry
If you aren't using a shaded JAR (which merges all JARs into a single JAR), then you'll need more JARs listed on your Java command. On Wed, Mar 23, 2022 at 12:16 PM Stefan Stegic wrote: > PS: I'm not using maven-shade (just opened the link you sent) > > On Wed, Mar 23, 2022 at 5:10 PM Stefan St

Re: DI container has no binding for key

2022-03-23 Thread Michael Gentry
Hi Stefan, Attachments, such as images, don't work on the mailing list. You can try uploading to imgur.com or similar and send the link to it. Have you tried updating your "java -cp myPlugin.jar path.to.Main" command to have more classpaths? mrg On Wed, Mar 23, 2022 at 12:10 PM Stefan Stegic

Re: Natural keys

2022-03-10 Thread Michael Gentry
Hi Tony, It has been a while since I've mapped natural primary keys, but Cayenne absolutely supports it. If my memory cells are working, you will map your natural key as a Java attribute (in the ObjEntity section). Normally, Cayenne excludes the PK from your Java/ObjEntity, but you can manually a

Re: Problem with optional to-one deletion

2021-11-17 Thread Michael Gentry
> 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 DbEntities. > > > > For example, in order_header, you have order_header -

Re: Problem with optional to-one deletion

2021-11-17 Thread Michael Gentry
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 DbEntities. For example, in order_header, you have order_header ->> order_detail_sales, but you've mapped that as To-Many AND To-Dependent PK, which doesn't make sense. On Tue, Nov 16, 2021

Re: Insertion order issue

2021-11-05 Thread Michael Gentry
er to > implement. Do you think that could impact this? If so, I'll spend some time > defining the custom sequences. I'll try on the few entities I'm working on. > > anthonin > > -Original Message- > From: Michael Gentry > Sent: Friday, November 5, 2021

Re: Insertion order issue

2021-11-05 Thread Michael Gentry
otocol$ConnectionHandler.process(AbstractProtocol.java:880) > [tomcat-coyote.jar:9.0.40] > at > org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1601) > [tomcat-coyote.jar:9.0.40] > at > org.apache.tomcat.util.net.SocketProcessorBase.run(S

Re: Insertion order issue

2021-11-04 Thread Michael Gentry
Hi Anthonin, Perhaps put a @SortWeight(2) annotation [1] on your child entity? Also, you need to configure a different entity sorter: // Need WeightedAshwoodEntitySorter for @SortWeight to work. ModuleentitySorterModule = (binder) -> binder.bind(EntitySorter.class).to(WeightedAshwoodEntit

Re: Ordering objects by primary keys

2021-10-30 Thread Michael Gentry
I had 100% forgotten about MarkMail -- thanks for the reminder! On Sat, Oct 30, 2021 at 4:09 AM Aristedes Maniatis wrote: > Its old, but still fast and works well: > https://markmail.org/search/?q=list%3Aorg.apache.cayenne.user+%22db%3A%22 > > Ari > > > On 30/10/21 1:01am,

Re: Ordering objects by primary keys

2021-10-29 Thread Michael Gentry
Fun fact: I have years worth of Cayenne mailing list content in GMail, but you can't search for db: in it because GMail uses prefix:term as an advanced search option and it doesn't know what to do with db: ... On Thu, Oct 28, 2021 at 2:38 AM giulio.ces...@gmail.com < giulio.ces...@gmail.com> wrot

Re: Cayenne Version 4.0 Logging

2021-09-20 Thread Michael Gentry
Hi Keena, At some point you may want to consider switching to HikariCP [1]. I don't remember the exact numbers, but a couple years ago I switched a Cayenne application from DBCP to HikariCP and the speed increase was noticeable. The more faults (lazy loads) your application does fetching in relati

Re: Dealing with a commit exception....

2021-06-24 Thread Michael Gentry
10 is a rather small batch size. I'd suggest at least 100, perhaps even 1000, unless you are expecting tons of problem records. For your hashing concerns, could you maybe store that in an H2 DB you use for this migration? On Wed, Jun 23, 2021 at 12:54 PM Tony Giaccone wrote: > Yeah, that's not

Re: SSL connections to postgresql in Azure

2021-06-10 Thread Michael Gentry
l Logistics > > PO Box 1039, Augusta, ME, 04332 > > Office: 207.620.8670 > > *ascentgl.com* <http://ascentgl.com/> > > > > > -- > *From:* Michael Gentry > *Sent:* Wednesday, June 9, 2021 1:37 PM > *To:* Cayenne Users > *Subject:* Re: SSL connections to postgresql

Re: SSL connections to postgresql in Azure

2021-06-09 Thread Michael Gentry
gusta, ME, 04332 > > Office: 207.620.8670 > > *ascentgl.com* <http://ascentgl.com/> > > > > > -- > *From:* Michael Gentry > *Sent:* Wednesday, June 9, 2021 12:26 PM > *To:* Cayenne Users > *Subject:* Re: SSL connections to postg

Re: SSL connections to postgresql in Azure

2021-06-09 Thread Michael Gentry
Hi Rick, Are you connecting: a) local development system -> Azure Postgres b) Azure server -> Azure Postgres? If "a", are there SSL certificates from Azure you need to load into your local Java environment. Or you could try turning off SSL verification. See more (for both options) here: https:/

Re: Examples of Cayenne Tapestry apps

2021-06-09 Thread Michael Gentry
Using Spring/Thymeleaf+JPA currently...really missing Tapestry+Cayenne--much more elegant, IMO. On Tue, Jun 8, 2021 at 11:32 PM Robert Zeigler wrote: > I haven't really been involved in java for a long time (primarily python > these days), but nice to see that someone else picked up what Kevin

Re: Examples of Cayenne Tapestry apps

2021-05-12 Thread Michael Gentry
Hi Tim! The Tapestry+Cayenne apps I worked on weren't open source, but the combination worked amazingly well for us. In the largest one, we had a small user base, but the object graph being edited could be 100s or for a few, over 1000 records [1]. Because the number of records could take a while

Re: PK Generation and FrontBase

2021-04-16 Thread Michael Gentry
Hi Jérémy, I've never used it, but Andrus (and others) have a project called LinkMove which may work: https://github.com/nhl/link-move I don't see a way to re-use a Cayenne model as the source AND the target, but perhaps that is also an option (instead of the XML source), too. On Fri, Apr 16,

Re: 4.1 informix jdbc issue

2020-09-11 Thread Michael Gentry
Hugi...you need to save that story for Halloween... On Thu, Sep 10, 2020 at 3:00 PM Hugi Thordarson wrote: > Hi Sébastien, > > Do you have the option of upgrading the Informix JDBC-driver? I seem to > recall that their more recent drivers *do* support > prepareStatement(String,int) but to use a

Re: Expression to compare a property against another property

2020-09-10 Thread Michael Gentry
Hi Faizel, What version of Cayenne are you using? That will influence the feedback we can provide. On Thu, Sep 10, 2020 at 5:00 PM Faizel Dakri wrote: > Is there a facility in Cayenne to create an expression that would compare > a property of one object against another property (maybe via a r

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

2020-09-05 Thread Michael Gentry
I'm naive enough that I'd just use a macro in Emacs to modify the mapping... On Sat, Sep 5, 2020 at 5:14 AM Hugi Thordarson wrote: > Hi all, > I'm adding some standard attributes to a few dozen tables. Since they all > look more or less the same, I'd like to do it programmatically. > That's eas

Re: springboot and cayenne

2020-08-10 Thread Michael Gentry
+1 for Hikari. I don't remember the numbers off the top of my head, but I switched from DBCP to Hikari a few years ago and the speed improvement was pretty noticeable. The gains seemed to largely come from relationship faults as you could get and return your DB connection faster with Hikari. On

Re: Check for certain changes in @PreUpdate listener class

2020-07-16 Thread Michael Gentry
ion when dealing with FKs (when to-one > relationships are modified). > > I've opted to just don't update modificationDate when relationships are > touched for now so… At least halfway there :). > > Thanks, > - hugi > > > > > On 13 Jul 2020, at 13:23, Mic

Re: Check for certain changes in @PreUpdate listener class

2020-07-13 Thread Michael Gentry
Hi Hugi, You might have to compare everything to be certain. Here is something I've used in the past (for Cayenne 3.x) which might be helpful: https://gist.github.com/mrg/4dce22b67175c27f4047#file-cayenneutils-java-L105 On Mon, Jul 13, 2020 at 9:11 AM Hugi Thordarson wrote: > Hi all. > Almos

Re: [OT] I demand change

2020-07-13 Thread Michael Gentry
Clearly The Google doesn't know enough about you. Try DuckDuckGo and see if it is better! :-) On Mon, Jul 13, 2020 at 5:16 AM Hugi Thordarson wrote: > That's it. I'm sick and tired of Porsche polluting my search results. > > http://chng.it/ySkvT5DK7z > > Cheers, > -

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

2020-07-13 Thread Michael Gentry
Hi Faizel, If you don't have many entities where deleting is important, you could put "delete" type methods in your subclasses. For example, if you have LineItem and a to-many to Order, in LineItem.java add a deleteFromOrders(Order order) { ... } method which will remove and delete the Order obje

Re: Migrating from exposed, compund PKs to single-column db generated keys

2020-07-09 Thread Michael Gentry
Hi Hugi, Are the legacy systems that are accessing this DB doing inserts? If so, check if the DB has a way to do an automatic generated PK for that column's value if it is null upon insert. If the inserts are only done from the Cayenne-based system, you'll be OK there. Not sure if there'd be up

Re: Building Master Branch

2020-05-26 Thread Michael Gentry
Hi Malcolm, Did you use mvn verify or mvn install? I seem to recall having a problem using install instead of verify. On Tue, May 26, 2020 at 6:17 AM Malcolm Edgar wrote: > Hi All, > > I am wanting to build the Cayenne master branch to explore adding support > for Postgres JSON, JSONB data ty

Re: likeIgnoreCase

2020-04-16 Thread Michael Gentry
gt; > On Thu, Apr 16, 2020 at 7:21 AM Michael Gentry > wrote: > > > Hi Lon, > > > > What does your pattern look like? Did you try adding a "?s" to your > > expression? > > > > > > On Wed, Apr 15, 2020 at 11:05 PM Lon Varscsak >

Re: likeIgnoreCase

2020-04-16 Thread Michael Gentry
Hi Lon, What does your pattern look like? Did you try adding a "?s" to your expression? On Wed, Apr 15, 2020 at 11:05 PM Lon Varscsak wrote: > Hey all, trying to use likeIgnoreCase on an in-memory list and it appears > not to work if there is a new line in the text. The Pattern would need >

Re: MySQL + Iterated/Streamed Query

2020-03-18 Thread Michael Gentry
needed for ResultSet objects > generated by this Statement. If the value specified is zero, then the hint > is ignored. The default value is zero." > > Andrus > > > > > On Mar 17, 2020, at 4:54 PM, Michael Gentry wrote: > > > > Do you use Integer.MIN_VALUE for t

Re: MySQL + Iterated/Streamed Query

2020-03-17 Thread Michael Gentry
an alternative: add "useCursorFetch=true" URL parameter and use > "ObjectSelect.statementFetchSize(..)". > > Andrus > > > > On Mar 14, 2020, at 5:31 PM, Michael Gentry wrote: > > > > I'm trying to do an iterated query (using the 4.1

MySQL + Iterated/Streamed Query

2020-03-14 Thread Michael Gentry
I'm trying to do an iterated query (using the 4.1 RC) against MySQL and it appears that the MySQL JDBC driver loads everything into memory first instead of streaming results. This results in memory-related exceptions for larger results. >From searching, it appears that the MySQL JDBC driver needs

Re: Using Cayenne with unsupported relational databases

2020-02-12 Thread Michael Gentry
Hi Salman, The Altibase website says "Altibase is a relational DBMS and is compatible and interoperable with Oracle." Please try using the Oracle JDBC driver and Cayenne will treat the DB (and SQL generation) as Oracle. If that doesn't work and you need to use an Altibase JDBC driver, let us kno

Re: Cayenne and Mysql 8.x

2019-12-16 Thread Michael Gentry
Try going into Cayenne Modeler's preferences and adding the MySQL 8.x driver JAR to the CLASSPATH preference and see if it works for you. After adding, you may need to restart CM in order for the JAR to be utilized. On Mon, Dec 16, 2019 at 5:25 AM Feliks_Wang王祺童(PE) < feliks_w...@ks.gemteks.com>

Re: Need the specifications

2019-12-04 Thread Michael Gentry
Hi Pradeep, You are asking a loaded question and there will be varying opinions of advantages from different people and their use cases. That being said, here are my top-three: 1. Cayenne Modeler I prefer modeling and mapping my database to Java using a graphical tool. Perhaps that is because I

Re: Long primary keys

2019-11-13 Thread Michael Gentry
I also totally missed IntegerType in the stack trace. 😕 On Wed, Nov 13, 2019 at 8:42 AM Michael Gentry wrote: > Hi Andrus, > > I was basing my response due to the "Numeric Overflow" exception, which > sounds like a number too big to fit into a Long. If a BIGINT/

Re: Long primary keys

2019-11-13 Thread Michael Gentry
not invalidate the original question though - why wouldn't > Cayenne choose a Long here? > > My suggestion is to map this column as BIGINT in Cayenne, and it will do > the right thing. > > Andrus > > > > On Nov 13, 2019, at 4:29 PM, Michael Gentry

Re: Long primary keys

2019-11-13 Thread Michael Gentry
Hi Vemund! Long.MAX_VALUE is 9,223,372,036,854,775,807. NUMBER(38) is a lot more digits. Does your DB really have primary keys that large? To play Devil's Advocate: 9223372036854775807 / 1000 inserts/second / 60 seconds/minute / 60 minutes/hour / 24 hours/day / 365 days/year = 292,471,208 year

Re: Compound PK/FK fun

2019-10-21 Thread Michael Gentry
Hi Hugi, I have no idea if this will work, but try the following: * in Cayenne Modeler, add companyNumber (company_number) as an attribute for Company. * Regenerate classes. * In Company.java, override the setCompanyNumber method to check for nulls. If non-null, call the super; if null, ignore i

Re: Cayenne and classpath question and help

2019-10-17 Thread Michael Gentry
Hi Andrew, Are you using JRebel? I seem to recall someone posting a solution here about using JRebel during development and getting the Cayenne stack to reload properly. On Wed, Oct 16, 2019 at 11:24 PM Andrew Willerding wrote: > Hi, > > I have an application that dynamically loads jar files

Re: Marking an ObjectContext as "done, don't use"

2019-10-17 Thread Michael Gentry
Session-scoped isn't always bad, but it really depends on the nature of the application. Worked on one where the user would select a line item to edit and that could fetch in hundreds or even thousands of associated records (which could take a while to load). We'd keep them in a session-scoped OC

Re: Best Practice for blobs

2019-10-03 Thread Michael Gentry
I've always used a secondary table (1:1 relationship) which contained just the blob data. The parent table would have the metadata for the blob, and possibly other data as required. That way you can fetch in the name, file size, type, etc without fetching in the blob until needed. On Wed, Oct 2

Re: 4.2 modeler change

2019-10-02 Thread Michael Gentry
On Wed, Oct 2, 2019 at 11:10 AM Andrus Adamchik wrote: > As for the JS backend, the concern (at least from me) was that our > community is mostly Java developers, so it may be hard to support if a > primary author becomes unavailable. FWIW, it is less of a concern for me > these days, as JS world

Re: 4.2 modeler change

2019-10-02 Thread Michael Gentry
you are following the new > bugs? > > Thanks > > EmeCas > > > > > On Wed, Oct 2, 2019 at 7:42 AM Michael Gentry wrote: > > > I started a JavaFX prototype, but got bogged down (with other things) and > > haven't picked it back up again. Kind of hop

Re: 4.2 modeler change

2019-10-02 Thread Michael Gentry
I started a JavaFX prototype, but got bogged down (with other things) and haven't picked it back up again. Kind of hoping to do that again within the coming year... As to Ari's HTML/JS/CSS comment, if we went that route, it would likely be an Electron-based application, I think, with HTML/JS/CSS

Re: Sending data across the wire.

2019-09-18 Thread Michael Gentry
Jackson allows you to define custom un/marshalling mechanisms when needed so you can control what gets included. Years ago we had some code which allowed you to include/exclude properties/paths to build up a JSON object to return using read[Nested]Property(). Basically you'd explicitly define wha

Re: Sending data across the wire.

2019-09-17 Thread Michael Gentry
Hi Tony, Have you tried using Jackson? https://github.com/FasterXML/jackson https://www.baeldung.com/jackson On Tue, Sep 17, 2019 at 2:49 PM Tony Giaccone wrote: > So typically I create a Data Transfer Object to return values across the > wire that I have fetched and copy attributes from my

Re: Connection over SSH tunnel without password not working

2019-09-03 Thread Michael Gentry
Hi Rafael, Wouldn't you still need to provide the credentials? Your SSH tunnel is forwarding the bits to/from PostgreSQL, but your connection still needs to login to the database. Does Cayenne Modeler or IntelliJ have the password cached somewhere? On Mon, Sep 2, 2019 at 1:34 AM Rafael Bugajew

Re: Deleting a bunch of interrelated objects

2019-05-30 Thread Michael Gentry
I'm a fan of well-named things ... deleteWithoutMercy and horribleMutantRuntimeWithoutRelationships are fabulous! On Thu, May 30, 2019 at 6:44 AM Hugi Thordarson wrote: > Hi Jurgen, > > thanks for the suggestions :). I made a horrible hack just now, based on > the idea of having a different mod

Re: ExpressionFactory help

2019-02-04 Thread Michael Gentry
https://cayenne.apache.org/docs/3.1/cayenne-guide/#expressions On Mon, Feb 4, 2019 at 5:24 AM Amedeo Mantica wrote: > oh, cool, thank you ! > btw, where I can find docs for these ? > > > On 4 Feb 2019, at 11:20, Andrus Adamchik wrote: > > > > Sorry, forgot plus sign for outer join: > > > > Exp

Re: Large Results sets..

2018-10-23 Thread Michael Gentry
Hi Tony, I think you are looking for an Iterated Query: https://cayenne.apache.org/docs/4.0/cayenne-guide/#performance-tuning I'm not sure what version you are using, but it is similar in the 3.x releases, too (change the documentation pulldown if needed). mrg On Mon, Oct 22, 2018 at 11:43 AM

Re: Commit Exception

2018-09-29 Thread Michael Gentry
I'm a little late to this party, but here is the approach I'd take: 1. Use a batch size of N (in your case, this is 500, but it is really DB-specific as to what can be handled with an IN clause). 2. Read in N (or whatever is remaining) records from your data file and call your inserter method wit

Re: DataObject changes - before commit

2018-09-11 Thread Michael Gentry
Hi Matt, Cayenne already keeps track of the original values for you. This is needed in order to do optimistic locking, plus it allows Cayenne to only send over changes in a record instead of the entire record when you are doing an UPDATE. I haven't tried this approach on the field-based version

Re: [ANN] Cayenne 3.1.3 and 4.1.M2 releases

2018-07-25 Thread Michael Gentry
Thanks for putting the release together, Nikita! On Wed, Jul 25, 2018 at 1:04 PM Nikita Timofeev wrote: > I'm glad to announce two releases of Apache Cayenne. > > 3.1.3 - is a maintenance release with a couple of bug fixes [1] > > 4.1.M2 - is a much more interesting one, with cool new features.

Re: In memory DB for unit testing

2018-05-02 Thread Michael Gentry
Mike Kienenberger wrote: > The reason I went with having the db entirely in memory was to run > tests in parallel. Once you have a disk presence, you'll have to > worry about test collisions. > > On Wed, May 2, 2018 at 5:35 PM, Michael Gentry > wrote: > > Hi Ken, >

Re: In memory DB for unit testing

2018-05-02 Thread Michael Gentry
Hi Ken, To add to what Mike said, I've used H2 in the past with pretty good results. You can either let Cayenne create your schema or use something like Flyway/Liquibase if you have that integrated into your application already. One thing I do differently, though, is I create a temporary on-disk

Re: Check dirty before write?

2018-04-27 Thread Michael Gentry
On Fri, Apr 27, 2018 at 11:52 AM, Michael Gentry wrote: > Hi Ken, > > If you really need to know, I made some utility methods a while back which > determine true object dirty status: > Correction: True **context** dirty status.

Re: Check dirty before write?

2018-04-27 Thread Michael Gentry
Hi Ken, If you really need to know, I made some utility methods a while back which determine true object dirty status: https://gist.github.com/mrg/4dce22b67175c27f4047#file-cayenneutils-java-L124 mrg On Fri, Apr 27, 2018 at 11:40 AM, Ken Anderson wrote: > Makes sense Andrus - thanks. > > On

Re: Bad data…trying to compensate

2018-04-23 Thread Michael Gentry
Hi Lon, Can you update all of your current "0" values to null? Or set a PostLoad handler on your Java class and set "0" to null when you load it from the DB? On Mon, Apr 23, 2018 at 3:31 PM, Lon Varscsak wrote: > I have a foreign key id that is 0 (zero). Our old system would interpret > this

Re: New Modeler icons

2018-03-20 Thread Michael Gentry
Hi Ken, Such things are on my agenda, I've just been very lax at development recently: https://camo.githubusercontent.com/83c4ec936ec7b08144b87bbf81cde4f819960e09/68747470733a2f2f70656f706c652e6170616368652e6f72672f2537456d67656e7472792f4f626a656374456e74697479322e706e67 On Tue, Mar 20, 2018 at

Re: Fetching a to-many DbRelationship

2018-03-19 Thread Michael Gentry
h on Employees, but since I have a modeled DbRelationship I > imagined there's something a bit higher level. > > - hugi > > > > > > On 19 Mar 2018, at 12:32, Michael Gentry wrote: > > > > Hi Hugi, > > > > Do you mean something like lineItem.ge

Re: Fetching a to-many DbRelationship

2018-03-19 Thread Michael Gentry
Hi Hugi, Do you mean something like lineItem.getOrders(); ? On Mon, Mar 19, 2018 at 7:06 AM, Hugi Thordarson wrote: > Hi all, > I feel like this is something I should know so I'm almost hesitant to ask. > But… > > I have a DataObject - how do I read the value of a ToMany DbRelationship > it ha

Re: Truncating a table

2017-12-21 Thread Michael Gentry
Hi Maik, Raw SQL would certainly be the most efficient way. Even if you didn't use raw SQL, though, how were you planning on dealing with Cayenne's caches? I think this issue would, regardless of how you truncated the table. There are various options, I'm just trying to get a feel for your use

Re: Redacting db user name and password from XML

2017-12-18 Thread Michael Gentry
A disadvantage of this approach, though, is it puts the username/password on the command-line and/or the process list, plus potentially exposes it in command-line history, too. mrg On Mon, Dec 18, 2017 at 11:49 AM, Andrus Adamchik wrote: > Hi Mark, > > We've done quite a bit of work in Cayenne

Re: Redacting db user name and password from XML

2017-12-18 Thread Michael Gentry
Hi Mark, What type of application are you developing? For web applications, which I'd imagine are the most common cases, using a JNDI DataSource is the way to go. Your container (Tomcat, Jetty, etc) will provide database connection services to Cayenne through a JNDI lookup. If you aren't develo

Re: Multiple data sources

2017-12-12 Thread Michael Gentry
iate the two data stacks in the application. Do they belong > in separate data models? Or two nodes in the same model? Do you run two > separate cayenne stacks, with different contexts? > > But with your answer I think I understand how to get started. > > > Tony > > On 2017-12-

Re: URI for data object?

2017-12-12 Thread Michael Gentry
Hi Ken, I had some code somewhere that did this, but can't find it offhand. Nutshell version, I was storing the information in this format: EntityName:KeyName:KeyValue You can get that information from the Cayenne[1] (or DataObjectUtils if on 3.0) helper class. That format requires a single PK

Re: Multiple data sources

2017-12-07 Thread Michael Gentry
Hi Tony, I've not done this before, but pretty sure you'll need two DataNodes (to manage the two DB connections, one DB per node) and two DataMaps (one attached to each DataNode). Put the relevant Java classes/etc in the proper DataMap and Cayenne will then handle the routing for you. (Cayenne d

Re: 4.1.M1 on Maven Central

2017-10-25 Thread Michael Gentry
Ninja'd by Andrus! On Wed, Oct 25, 2017 at 7:03 AM, Michael Gentry wrote: > Hmm, I'm not seeing it: > > http://repo1.maven.org/maven2/org/apache/cayenne/cayenne-server/ > > > > On Wed, Oct 25, 2017 at 6:43 AM, Hugi Thordarson wrote: > >> Hi all, >&

Re: 4.1.M1 on Maven Central

2017-10-25 Thread Michael Gentry
Hmm, I'm not seeing it: http://repo1.maven.org/maven2/org/apache/cayenne/cayenne-server/ On Wed, Oct 25, 2017 at 6:43 AM, Hugi Thordarson wrote: > Hi all, > not entirely familiar with how the release phase works—has Cayenne 4.1.M1 > already been submitted to Maven Central? > > - hugi

Re: Cayenne-Tapestry integration problem

2017-10-12 Thread Michael Gentry
Hi Juan, In your Data Domain configuration (highest level item) in Cayenne Modeler, do you have Use Shared Cache checked? On Thu, Oct 12, 2017 at 2:14 PM, Juan Manuel Diaz Lara < jmdia...@yahoo.com.invalid> wrote: > I devoloped a module to integrate cayenne into apache-tapestry, using > cayenne

Re: Cayenne advantages

2017-10-10 Thread Michael Gentry
Actually, let me add a 3rd: 3) Great community. Everyone tries to be helpful and respectful here. On Tue, Oct 10, 2017 at 9:08 AM, Michael Gentry wrote: > Hi Ari, > > For me it is two primary things: > > 1) The ObjectContext. Our data has a top-level item which faults in

Re: Cayenne advantages

2017-10-10 Thread Michael Gentry
Hi Ari, For me it is two primary things: 1) The ObjectContext. Our data has a top-level item which faults in up-to tens of thousands of child records throughout a complex object graph. The UI allows editing of the entire object graph and navigating around the various levels. At the end, a sing

Re: For those who upgraded to Java 9

2017-09-23 Thread Michael Gentry
It seems like the Mac version is always the one breaking... On Sat, Sep 23, 2017 at 8:25 AM, Andrus Adamchik wrote: > Public service announcement for those who rushed to upgrade their dev > machines to the recently released JDK 9 as I did. If CayenneModeler no > longer starts, follow these inst

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Michael Gentry
PS. I did mention you might want to change the last line... On Wed, Sep 20, 2017 at 10:36 AM, Michael Gentry wrote: > Hi Mike, > > This is 3-4 year old 3.0 code which is working and I haven't updated it > yet. That's mainly it...not enough cycles. > > mrg > &g

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Michael Gentry
Hi Mike, This is 3-4 year old 3.0 code which is working and I haven't updated it yet. That's mainly it...not enough cycles. mrg On Wed, Sep 20, 2017 at 10:28 AM, Mike Kienenberger wrote: > Michael, > > Why do you suggest > > DataObjectUtils.objectForPK(destinationContext, > contractDesignati

Re: Question on how to properly create parent-child nested dependent objects?

2017-09-20 Thread Michael Gentry
Hi Andrew, I'm jumping in late here, but I did something very similar to what you are trying to do with CommunicationType.find(). I create (auto-populate) a reference table record based upon some enum values if missing, or just return the reference table record if I find it. I do this in a compl

Re: Quotes for 4.0 press release

2017-06-26 Thread Michael Gentry
The quote from us is still pretty valid. Just upgraded to 3.1 ... On Wed, Jun 21, 2017 at 7:32 AM, Andrus Adamchik wrote: > @ Cayenne Community -- > > We are preparing an ASF press release about Cayenne 4.0 Beta. If you are > using Cayenne (4.0 or older versions), I'd appreciate if you could s

Re: Cayenne Modeler Inheritance Warning

2017-06-09 Thread Michael Gentry
> > Some background: > > https://issues.apache.org/jira/browse/CAY-1600 > https://lists.apache.org/thread.html/01f69b73b99651f6ecf96fc24176b0 > e2d4f63d5af08e2f764e6f12bf@1332798063@%3Cuser.cayenne.apache.org%3E > > Andrus > > > > On Jun 8, 2017, at 6:30 PM, Mic

Cayenne Modeler Inheritance Warning

2017-06-08 Thread Michael Gentry
In converting an application from 3.0 to 3.1, have a validation warning in CM regarding a "Facility" abstract superclass which defines an "exhibit" relationship which is used by the subclasses. The warning is: Usage of super entity's relationships 'Facility.exhibit' as reversed relationships for

Re: Best method to fetch a lot of objects

2017-05-19 Thread Michael Gentry
like this: > > try(ResultBatchIterator it = > ObjectSelect.query(Artist.class).batchIterator(context, batchSize)) { > > for(List list : it) { >... > context.commitChanges(); > } > } > > Andrus > > > > On May 19, 2017, at 4:39 P

  1   2   3   4   5   6   7   8   9   >