Type safe queries more

2011-09-15 Thread Hugi Thordarson
Hi all. Cayenne beginner here. I come from an EOF/WebObjects background, so when I started using Cayenne (yesterday) I kinda missed the type safety and conciseness of using Mike Schrag's ERXKeys when constructing qualifiers and Orderings. So me and another EOF guy (@atlipall) sat down today

Re: Type safe queries more

2011-09-15 Thread Hugi Thordarson
: Attachments are not allowed by the mailing list - I'd suggest opening a JIRA and then sending a link to the list. Thanks! John On Thu, Sep 15, 2011 at 1:29 PM, Hugi Thordarson h...@karlmenn.is wrote: Hi all. Cayenne beginner here. I come from an EOF/WebObjects background, so when I started

Re: Type safe queries more

2011-09-16 Thread Hugi Thordarson
Hi Ari. Welcome to Cayenne. The work you have done is extremely welcome and has been discussed before: Thank you :). I encourage you to do a couple of things to follow this through and see if we can get this approach into Cayenne: 1. Take this over to the dev list (I'm copying that

Re: [OT] You're all a bunch of Cake Mixers

2011-10-19 Thread Hugi Thordarson
everyone is using it just because (some top manager told you to use it because all CV's ask for it). Regards and sorry again for the off-topic Bruno On Wed, Oct 19, 2011 at 11:04 AM, Hugi Thordarson h...@karlmenn.is wrote: Hey, Cayenne Developers! Stop destroying our joy of programming

Specifying what columns to fetch when using DataRows

2011-10-19 Thread Hugi Thordarson
Hi all. I'm using DataRow fetching to optimize some queries. How do I specify what columns to fetch? Can I do something like this: SelectQuery q = new SelectQuery( Person.class ); q.setFetchingDataRows( true ); q.setDataRowKeyPaths( Arrays.asList( name, department.name,

Can I specify join type for relationships in the model?

2011-10-25 Thread Hugi Thordarson
Good morning all. The subject says it all, really: Cayenne seems to default to inner joins for relationships. Is it possible for me to set the join type for relationships in the model, so I don't have to specify the join type for every query? (I always want outer joins) Cheers, - hugi

Relationships between datamaps in different projects

2011-11-03 Thread Hugi Thordarson
Hi all! Most of our projects share a set of common DB tables (users, permissions etc). The code and cayenne.xml for these entities resides in a standalone project, works great. However, I'm wondering if I can create relationships from entities in our client projects to entities in the common

Re: Relationships between datamaps in different projects

2011-11-03 Thread Hugi Thordarson
just had this discussion in my company recently, but no solution yet. If there are ideas how that can be implemented, let's discuss. Andrus On Nov 3, 2011, at 1:45 PM, Hugi Thordarson wrote: Hi all! Most of our projects share a set of common DB tables (users, permissions etc

Updating a flattened relationship when a rel. it depends on is modified?

2011-11-29 Thread Hugi Thordarson
Hi all. The subject says it all, really. Do I have any way to automatically update a flattened relationship when one of the relationships it depends on is updated? To clarify, let's say I have the following schema: Employee Department Company. Company has a flattened relationship

Re: Replacing EOF with Cayenne

2012-01-23 Thread Hugi Thordarson
Project Wonder adds support for Lists and Arrays in WORepetition, so you don't have to do that. I'm using Cayenne in a few WO projects, works great. Cheers, -hugi On 23.1.2012, at 20:26, John Huss wrote: The templates in the example app just have new NSArray() around the result of fetches

Re: Updating totals in a multi-user environment

2014-10-31 Thread Hugi Thordarson
undertaking? Or does Cayenne perhaps provide an alternative method to achieve the same results? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 31. okt. 2014, at 08:50, Andrus Adamchik and...@objectstyle.org wrote: My problem

Traversing relationships in DataRow queries?

2014-10-31 Thread Hugi Thordarson
Friday up here. // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Play Framework

2015-01-23 Thread Hugi Thordarson
Hi all! Does anyone here use Cayenne with Play Framework? In development mode, Play closes the DB connection every time a change is made to the application and creates a new one, making Cayenne lose contact with the DB. Any recommended workarounds for this? Cheers, - hugi // Hugi Thordarson

Re: Play Framework

2015-04-01 Thread Hugi Thordarson
to be beneficial for someone else. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 23. jan. 2015, at 12:24, Andrus Adamchik and...@objectstyle.org wrote: No experience with Play, but this is strange. Cayenne in no way relies

Re: DataObject accessor names - ditching the get prefix

2015-04-01 Thread Hugi Thordarson
) is autogeneration of classes every time the model changes. If this doesn’t currently exist in Cayenne I’d like to implement it. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 1. apr. 2015, at 12:47, Michael Gentry mgen...@masslight.net wrote

DataObject accessor names - ditching the get prefix

2015-04-01 Thread Hugi Thordarson
Hi all. Can I generate my DataObject classes without a “get”-prefix for attribute accessor names? I much prefer the style of “name()” over “getName()”. Cheers, - hugi PS: Sorry for my flooding of the list. Catching up on previous work on migration from EOF— I must say 4.0.M2 looks just

Re: Cayenne (and LinkRest) presentations at WOWODC in Hamburg

2015-04-01 Thread Hugi Thordarson
Ooohlala, can we get a live stream? :) - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 1. apr. 2015, at 10:56, Andrus Adamchik and...@objectstyle.org wrote: A reminder for those who are interested in both WebObjects and Cayenne - I am giving

Re: Traversing relationships in DataRow queries?

2015-04-01 Thread Hugi Thordarson
( A.SOME_REL.joint() ) instead of just doing addPrefetch( “someRel” )? When traversing further relationships, is this the correct way? : q.addPrefetch( PrefetchTreeNode.withPath( shop.chain, 1 ) ); Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Traversing relationships in DataRow queries?

2015-04-01 Thread Hugi Thordarson
While this doesn’t: SelectQueryDataRow q = SelectQuery.dataRowQuery( SMReceipt.class ); q.addPrefetch( SMReceipt.SHOP.getName() ); ListDataRow list = objectContext.select( q ); Should I file a bug report? Very surprising. This should generate a disjoint prefetch (i.e. a query #2,

Re: DataObject accessor names - ditching the get prefix

2015-04-01 Thread Hugi Thordarson
Ah, excellent! Where inside ERCayenne are they though, can’t find them at a quick glance. - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 1. apr. 2015, at 14:03, John Huss johnth...@gmail.com wrote: There are WO friendly templates for Cayenne

Re: Prefetch nullifies relatinoship?

2015-05-13 Thread Hugi Thordarson
Also is there anything special about the relationship, or is it a simple to-one ? Whoops, sorry. Yes — it’s just a simple one-to-one based on an integer column. - hugi

Re: The Datamap class?

2015-05-13 Thread Hugi Thordarson
Thanks, I suspected as much :) - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 13. maí 2015, at 08:35, Andrus Adamchik and...@objectstyle.org wrote: Correct. Datamap class may have more good stuff in the future, but for now it is of limited

Re: Prefetch nullifies relatinoship?

2015-05-13 Thread Hugi Thordarson
template—I’m just using slightly modified templates for easier conversion of my old EOF code. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 13. maí 2015, at 09:00, Andrus Adamchik and...@objectstyle.org wrote: Actually it is performed

Re: Prefetch nullifies relatinoship?

2015-05-13 Thread Hugi Thordarson
Hi Andrus. Sure, here it is. Looks like a fetch is never performed for the “products” relationship… https://gist.github.com/hugith/6d0ccde4aa8877e26454 https://gist.github.com/hugith/6d0ccde4aa8877e26454 *sigh* not enough coffee in me yet. Of course it performs a fetch :). The objects

The Datamap class?

2015-05-12 Thread Hugi Thordarson
instance of itself. Can I delete it? - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Prefetch nullifies relatinoship?

2015-05-13 Thread Hugi Thordarson
On May 13, 2015, at 12:29 PM, Hugi Thordarson h...@karlmenn.is wrote: Thanks Andrus. Setting the semantics to PrefetchTreeNode.JOINT_PREFETCH_SEMANTICS made the relationship resolve properly (and modified the SQL to use a join rather than a separate fetch for fetching the products). Looks

Prefetch nullifies relatinoship?

2015-05-12 Thread Hugi Thordarson
Hi all. I have a weird case (using Cayenne 4.0-M2) where if I add a prefetch to a relationship, the relationship is nullified (will contain nothing). Consider the following code: SelectQueryProductLink q = SelectQuery.query( ProductLink.class ); q.addPrefetch( ProductLink.PRODUCT_KEY ); //

Re: Generating SQL from an Expression (for use in a utility method)

2015-05-20 Thread Hugi Thordarson
-queries On May 20, 2015, at 1:45 PM, Hugi Thordarson h...@karlmenn.is wrote: Thanks, I’ll look into this as an alternative to the SQLTemplate query. On a related note, is there any way to perform an iterative fetch using SQLTemplate or EJBQL queries, rather than pulling the entire result

Re: Generating SQL from an Expression (for use in a utility method)

2015-05-20 Thread Hugi Thordarson
Thanks Michael, SelectTranslator was exactly what I needed. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 19. maí 2015, at 15:36, Michael Gentry mgen...@masslight.net wrote: Hi Hugi, Perhaps this can help you: https://github.com

Generating SQL from an Expression (for use in a utility method)

2015-05-19 Thread Hugi Thordarson
Hi all. I’m creating a little utility method to emulate functionality from EOF, i.e. to allow me to fetch distinct values for specified columns. This is what I have so far: https://gist.github.com/hugith/05de4ad2f3d6f2cdc16a https://gist.github.com/hugith/05de4ad2f3d6f2cdc16a However, I

Re: [4.0M2] Bug in EJBQL generation for not expressions? (missing rootId)

2015-06-22 Thread Hugi Thordarson
hope you are otherwise enjoying using Cayenne? :) cheers. On 23/06/15 07:03, Hugi Thordarson wrote: Hi all. Assuming “Device” is a DataObject class containing a property named “username”, this code: Device.USERNAME.isNull().toEJBQL( alias” ); results in: alias.username is null

Re: [4.0M2] Bug in EJBQL generation for not expressions? (missing rootId)

2015-06-24 Thread Hugi Thordarson
Thanks a lot Andrew! Cheers, - hugi On 23. jún. 2015, at 10:13, Andrew Lindesay a...@lindesay.co.nz wrote: Hi Hugi; OK that should be working now in master branch. Glad to hear that it is working out for you! cheers. On 23/06/15 08:47, Hugi Thordarson wrote: Thanks Andrew

[4.0M2] Bug in EJBQL generation for not expressions? (missing rootId)

2015-06-22 Thread Hugi Thordarson
is: not (username = null) I.e., it’s missing the alias and thus the query fails. Isn’t this a bug? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ // s. 895-6688

Re: Cayenne and threading

2015-06-18 Thread Hugi Thordarson
and save. Or do the write as plain sql. On Thu, Jun 18, 2015 at 5:17 PM Hugi Thordarson h...@karlmenn.is wrote: Thanks for the reply John, I suspected it couldn’t really be *this* good :). But if there are any takers, I’d love to hear how experienced folks would approach multithreaded DB writes

Re: Cayenne and threading

2015-06-18 Thread Hugi Thordarson
, especially with lambdas. John On Thu, Jun 18, 2015 at 4:31 PM Hugi Thordarson h...@karlmenn.is wrote: Hi all. Coming from EOF I’ve been mentally trained to believe anything threaded will bite you in the ass in a bad way. Using Cayenne, I’m now writing threaded code and loving it, but I just

Sharing a database with EOF: Primary key generation

2015-05-22 Thread Hugi Thordarson
) Cheers, - hugi PS: Sorry for spamming the list with my stupid questions these days: hopefully I’ll be able to contribute in a meaningful way soon, rather than just sucking at the teat of your knowledge :). // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Canceling a fetch

2015-05-22 Thread Hugi Thordarson
Hi all. Is there any way to gracefully cancel/stop a long running fetch in Cayenne? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Expression to look for objects with an empty to-many relationship?

2015-07-28 Thread Hugi Thordarson
be great if you submitted an expression type that supported this trivially. Let’s hope it ends up that way :). - hugi On Fri, Jul 24, 2015 at 12:56 PM, Hugi Thordarson h...@karlmenn.is wrote: Indeed :). I’ve been looking at the Expression classes for a while now and they look a little daunting

Re: Implementing and audit log using Cayenne; finding what was modified in an object

2015-08-08 Thread Hugi Thordarson
Thanks a lot for your help Michael, I’m going to try my hand at this today and post my results to the list. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 7. ágú. 2015, at 16:51, Michael Gentry mgen...@masslight.net wrote: Hi Hugi

Prefetching all child nodes in a tree

2015-08-08 Thread Hugi Thordarson
( Item.CHILDREN.dot( Item.CHILDREN ).dot( Item.CHILDREN ).joint() ); query.addPrefetch( Item.CHILDREN.dot( Item.CHILDREN ).dot( Item.CHILDREN ).dot( Item.CHILDREN ).joint() ); Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Prefetching all child nodes in a tree

2015-08-08 Thread Hugi Thordarson
/questions/17358109/how-to-retrieve-all-recursive-children-of-parent-row-in-oracle-sql Once you know what the SQL will look like, using SQLTemplate can generate a list of entities for you after executing the query. On Sat, Aug 8, 2015 at 7:14 AM, Hugi Thordarson h...@karlmenn.is wrote: Hi all

Re: Prefetching all child nodes in a tree

2015-08-09 Thread Hugi Thordarson
to add a new Expression type to do so, although it'll probably only work for a select set of databases. On Sat, Aug 8, 2015 at 2:05 PM, Hugi Thordarson h...@karlmenn.is wrote: Thanks Mike. I’m currently using MySQL (and in the process of migrating to PostgreSQL) and there are ways to do

Expressions involving dates can't be converted to EJBQL?

2015-08-11 Thread Hugi Thordarson
Hi all. I have a utility method that selects a row count given a DataObject class and an Expression, as seen here: https://gist.github.com/hugith/d2cdaf60a6ee12aa0d17 https://gist.github.com/hugith/d2cdaf60a6ee12aa0d17 I was using this today when I suddenly got the error message the scalar

Re: Obtain primary key for DataObject before commitChanges

2015-08-11 Thread Hugi Thordarson
transaction -- I'm not certain, but maybe that could work. Transaction support either wasn't there back when I was doing this or I didn't understand that it could solve my problem back then. On Mon, Aug 10, 2015 at 10:13 AM, Hugi Thordarson h...@karlmenn.is wrote: Thanks Mike! Although

Re: Java 8 Date/Time API and Cayenne

2015-08-07 Thread Hugi Thordarson
Ah, thanks a lot for this! I’ll try it out once M3 is stable and published to central. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 7. ágú. 2015, at 08:17, Savva Kolbachev s.kolbac...@gmail.com wrote: Yeah. You need to add

Re: Java 8 Date/Time API and Cayenne

2015-08-06 Thread Hugi Thordarson
Ah, brilliant, thanks! Do I have to do anything to configure, load or add the module? Just setting the datatype (java.time.LocalDateTime) in the model doesn’t seem to work. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 6. ágú. 2015

Re: Implementing and audit log using Cayenne; finding what was modified in an object

2015-08-07 Thread Hugi Thordarson
is for Cayenne 3.0, so there might be a few tweaks needed for 3.1. mrg On Fri, Aug 7, 2015 at 10:16 AM, Hugi Thordarson h...@karlmenn.is wrote: Hi all. I’m attempting to implement an audit log using Cayenne, automatically storing information on modifications alongside every insert

Implementing and audit log using Cayenne; finding what was modified in an object

2015-08-07 Thread Hugi Thordarson
could point me in the correct direction :). Thanks once again, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Expressions involving dates can't be converted to EJBQL?

2015-08-12 Thread Hugi Thordarson
: Hi Hugi; I think this was me; see CAY-1932 for some details on what I did there. cheers. On 12/08/15 10:09, Hugi Thordarson wrote: Hi all. I have a utility method that selects a row count given a DataObject class and an Expression, as seen here: https://gist.github.com/hugith

Re: Obtain primary key for DataObject before commitChanges

2015-08-12 Thread Hugi Thordarson
? Does your problem just require Bob changed record 23 or are you keeping a complete diff of the changes? If the latter, how are you serialising those changes into the audit log? Ari On 12/08/2015 8:13am, Hugi Thordarson wrote: Thanks for the ideas Mike. After a little mulling, I think

Re: Expressions involving dates can't be converted to EJBQL?

2015-08-12 Thread Hugi Thordarson
, Hugi Thordarson wrote: Hi Andrew, thanks for that. I see what the problem is. But if I can’t use EJBQL when generating queries that use dates, can I go down any different paths or do I have to revert to writing plain old SQL? -- Andrew Lindesay

Obtain primary key for DataObject before commitChanges

2015-08-10 Thread Hugi Thordarson
Hi all. Is it possible for me to obtain the primary key for a Cayenne DataObject before committing changes? I’m writing an audit log and I need the key for the object during PrePersist (where I’m constructing the log object). Cheers, - hugi

Re: Obtain primary key for DataObject before commitChanges

2015-08-10 Thread Hugi Thordarson
Is it possible for me to obtain the primary key for a Cayenne DataObject before committing changes? I’m writing an audit log and I need the key for the object during PrePersist (where I’m constructing the log object). How will it have a primary key before the record is written to the

Re: Obtain primary key for DataObject before commitChanges

2015-08-10 Thread Hugi Thordarson
Thanks Mike! Although the approach I’m working on is a little different (and meant to be reusable with any Cayenne installation so can’t depend on superclass template modifications), it’s very helpful to see code from other Cayenne folks. Cheers, - hugi // Hugi Thordarson // http

Java 8 Date/Time API and Cayenne

2015-08-06 Thread Hugi Thordarson
Hi all. I’m starting new project and I’m pondering using the new Java 8 Date/Time API’s in the data model. Is anyone using them already with Cayenne, and if so, any words of warning (or words of encouragement :)? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http

Re: Expression to look for objects with an empty to-many relationship?

2015-07-24 Thread Hugi Thordarson
: a.paintingArray+ = null Also EJBQL syntax supports IS [NOT] EMPTY : SELECT a FROM Artist a WHERE a.paintingArray IS EMPTY Andrus On Jul 24, 2015, at 5:51 PM, Hugi Thordarson h...@karlmenn.is wrote: Hi all. Does Cayenne have an Expression class that allows searching for objects with an empty

Re: Expression to look for objects with an empty to-many relationship?

2015-07-24 Thread Hugi Thordarson
and...@objectstyle.org wrote: Classic open source - scratch your own itch :) On Jul 24, 2015, at 6:54 PM, Hugi Thordarson h...@karlmenn.is wrote: Thanks Andrus, we’ll revert to EJBQL for now. Looks like an excellent opportunity to try and implement my first Expression class :) - hugi On 24

Re: Counting distinct related objects using EJBQL

2015-11-09 Thread Hugi Thordarson
, there's a woraround described in Jira - if possible use a unique > attribute of the target object inside COUNT. E.g. a.shop.name (if no such > attribute exists, map ID as an ObjAttribute, and use that). > > Andrus > >> On Oct 30, 2015, at 2:45 PM, Hugi Thordarson <h...@

Counting distinct related objects using EJBQL

2015-10-30 Thread Hugi Thordarson
Hi all, and a very happy Friday to you. How would I go about counting distinct related objects using EJBQL? If I want to count the number of “Shops" related to “Receipts", I’d expect to be able to do use EJBQL like this, which works fine for regular attributes: SELECT count(distinct a.shop)

Re: Reading boolean values stored in a database as chars

2015-10-08 Thread Hugi Thordarson
; runtime, but you could have one that detects and switches > behavior dynamically I guess. > > On Wed, Oct 7, 2015 at 12:19 PM Hugi Thordarson <h...@karlmenn.is > <mailto:h...@karlmenn.is>> wrote: > >> Hi all. >> >> Oh the joys of working with legacy

Re: Reengineering a Postgres DB schema not working in Modeler?

2015-10-08 Thread Hugi Thordarson
che.org/jira/browse/CAY-1994> > > Best regards, > Savva > > 2015-10-08 13:32 GMT+03:00 Hugi Thordarson <h...@karlmenn.is>: > >> Hi all. >> I’m attempting to reengineer a Postgresql (9.3) DB in Cayenne Modeler and >> I’m not getting any entities. It just c

Reengineering a Postgres DB schema not working in Modeler?

2015-10-08 Thread Hugi Thordarson
Hi all. I’m attempting to reengineer a Postgresql (9.3) DB in Cayenne Modeler and I’m not getting any entities. It just connects to the database and then creates an empty datamap with no tables (and yes, I’m quite sure I’m using the correct schema and catalog :). Just wanted to check if someone

Re: Reengineering a Postgres DB schema not working in Modeler?

2015-10-08 Thread Hugi Thordarson
10-08 15:02 GMT+03:00 Hugi Thordarson <h...@karlmenn.is>: > >> Ah, awesome, thanks! I suspected this was the case and I’ve been trying to >> build the modeler from 4.0.M3 this morning. The jars created in the modeler >> projects’ target directories are not executable, are

Ordering a list and returning the ordered version

2015-10-12 Thread Hugi Thordarson
Hi all. I’ve seen orderList() in Ordering and Property which sort the list in place and return nothing, but is there a method to order a list and return a copy? If not, would you be opposed to copying EOF’s API for this? ERXKey (EOF’s equivalent of Cayenne’s Property) has two methods “sort()”

likeIgnoreCase queries and EJBQL

2015-10-12 Thread Hugi Thordarson
Hi all. I’m communicating with a database that doesn’t have the UCASE function, only UPPER. When I use case insensitive expressions (for example, User.NAME.likeIgnoreCase(“Bob”)) in a regular SelectQuery, Cayenne generates SQL using the “UPPER” function (for expressions generated using

Reading boolean values stored in a database as chars

2015-10-07 Thread Hugi Thordarson
Hi all. Oh the joys of working with legacy databases… :) I’m now using a database that sometimes stores boolean values as a char field with the value ’t’ or ‘f’ (true or false). Can Cayenne help me map these fields to actual booleans in my entities so I don’t have to think about this in my

Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
, - hugi // Hugi Thordarson // http://www.loftfar.is/ // s. 895-6688

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
sion of > cayenne while you wait until it's included in a release. > > On Mon, Oct 12, 2015 at 12:46 PM, Hugi Thordarson <h...@karlmenn.is> wrote: >> Hi all. >> >> I’m communicating with a database that doesn’t have the UCASE function, only >> UPPE

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
; > Hi Hugi, > > What are you using for PK generation? PostgreSQL's sequence generator > should prevent duplicates. Make sure the number of keys it is allocating > matches what Cayenne is using, though, otherwise you'll run into issues. > > mrg > > > On Tue, O

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
:45, Hugi Thordarson <h...@karlmenn.is> wrote: > >> {fn ucase} is JDBC escape syntax, so presumably the driver should convert >> that to the proper syntax. If a given driver is not capable of doing that, >> that has to be addressed in DbAdapter for that DB. >>

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
hugi > > Andrus > > >> On Oct 13, 2015, at 5:31 AM, Hugi Thordarson <h...@karlmenn.is> wrote: >> >> Thanks Mike! >> >> I’m not sure it this is a database plugin problem though. Doing regular case >> insensitive queries works fine, it’s only queri

Re: likeIgnoreCase queries and EJBQL

2015-10-13 Thread Hugi Thordarson
tiple driver > versions. > > > On Tue, Oct 13, 2015 at 11:16 AM, Hugi Thordarson <h...@karlmenn.is> wrote: >> I’m not sure how useful my work would be since I’m writing against a 15 year >> old Informix version, incompatible with modern JDBC-drivers (for example, >&g

Re: Duplicate primary keys in Postgresql

2015-10-13 Thread Hugi Thordarson
lar place where we could have documented this where > it would have become obvious to you during the migration? > > On Tue, Oct 13, 2015 at 9:55 AM, Hugi Thordarson <h...@karlmenn.is> wrote: >> Thanks Michael, that was it. The sequences I was using were leftorvers from >> EOF a

Always using outer joins

2015-08-27 Thread Hugi Thordarson
. So, I ask: Is there any way for me to ask Cayenne to implicitly perform outer joins when filtering on expressions, unless explicitly otherwise stated? For example, when modeling relationships? (as is done in EOF) Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is

Re: Getting the currently active ServerRuntime

2015-08-27 Thread Hugi Thordarson
and your framework in your app MyModule m = new MyModule(); ServerRuntime runtime = new ServerRuntime(myproject.xml, m); MyFramework f = runtime.getInjector().getInstance(MyFramework.class); // now you can call methods on f. Andrus On Aug 27, 2015, at 11:54 AM, Hugi Thordarson h

Error when executing EJBQL generated from an expression containing outer joins

2015-08-27 Thread Hugi Thordarson
Boy… I’m really drowning you folks with mail today. Sorry about that. The gist below shows code where I’m attempting to perform an EJBQL query using a where clause generated from an Expression containing an outer join. If I don’t do an outer join (i.e. just drop the outer() call when generating

Re: Always using outer joins

2015-08-28 Thread Hugi Thordarson
it ended up where it is now. Andrus On Aug 27, 2015, at 6:37 PM, Hugi Thordarson h...@karlmenn.is wrote: Hi all. I find that when I query over relationships I (and my users) almost always want an outer join. For example, if I ask for a list of Employee objects based

Re: Getting the currently active ServerRuntime

2015-08-28 Thread Hugi Thordarson
That’s great, thanks! - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688 On 27. ágú. 2015, at 18:04, Andrus Adamchik and...@objectstyle.org wrote: You can add it to a List of project locations inside your Module 'configure': public void configure

Re: Obtain primary key for DataObject before commitChanges

2015-08-27 Thread Hugi Thordarson
I like the simplicity of this approach. Makes me think I might be designing myself to hell with my somewhat convoluted multi-table monstrosity :). Cheers, - hugi On 12. ágú. 2015, at 15:05, Mike Kienenberger mkien...@gmail.com wrote: On Tue, Aug 11, 2015 at 8:49 PM, Aristedes Maniatis

Getting the currently active ServerRuntime

2015-08-27 Thread Hugi Thordarson
way for me to smooth out this operation by making the framework automatically obtain the active ServerRuntime in the current environment? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ http://www.loftfar.is/ // s. 895-6688

Re: Obtain primary key for DataObject before commitChanges

2015-08-27 Thread Hugi Thordarson
data in the DB. I guess ideally we should be creating field objects and store creation/deletion dates along with them. Any ideas are very much welcomed here as well :). As you can see, this is very much a work in progress. Cheers, - hugi Ari On 12/08/2015 6:18pm, Hugi Thordarson wrote

Re: Obtain primary key for DataObject before commitChanges

2015-08-27 Thread Hugi Thordarson
For INSERTs, are you planning on storing all of the original values in TransactionObjectFieldValue rows? Yes - hugi

Re: Getting the currently active ServerRuntime

2015-08-27 Thread Hugi Thordarson
On 27/08/2015 6:37pm, Hugi Thordarson wrote: I’m writing a Cayenne-based CRUD framework of sorts, in the form of a jar that plugs into Cayenne applications. Is there overlap with this: http://nhl.github.io/link-rest/ which was already built over the top of Cayenne? Not really, what

Re: Error when executing EJBQL generated from an expression containing outer joins

2015-09-07 Thread Hugi Thordarson
> >> On Aug 27, 2015, at 11:46 PM, Hugi Thordarson <h...@karlmenn.is> wrote: >> >> Boy… I’m really drowning you folks with mail today. Sorry about that. >> >> The gist below shows code where I’m attempting to perform an EJBQL query >> using a whe

Re: Committed values of an object

2015-08-25 Thread Hugi Thordarson
DataContext dataContext = (DataContext)object.getObjectContext(); ObjectStore objectStore = dataContext.getObjectStore(); DataRow snapshot = objectStore.getSnapshot( object.getObjectId() ); Note that the keys in the returned snapshot correspond to your DbEntity rather than your ObjEntity.

Re: Is there a canonical method of invoking aggregate functions

2015-09-13 Thread Hugi Thordarson
. I want to be a little more familiar with Cayenne before suggesting such a thing, though, since I want to be able to help out with the migration and the flood of users that will hopefully follow. Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ <http://www.loftfar.is/> // s. 89

Re: Anyone using Cayenne with Informix?

2015-09-11 Thread Hugi Thordarson
k. Most > adapter customizations for other DBs are dealing with edge cases, stored > procedures, driver metadata capabilities and such. > > Andrus > >> On Sep 11, 2015, at 1:24 PM, Hugi Thordarson <h...@karlmenn.is> wrote: >> >> Hi all. >> >

Re: Switching to Java 1.7

2015-09-11 Thread Hugi Thordarson
Awesome :) - hugi > On 11. sep. 2015, at 10:33, Andrus Adamchik wrote: > > FYI. Feel free to comment. > >> Begin forwarded message: >> >> From: Andrus Adamchik >> Subject: Switching to Java 1.7 >> Date: September 7, 2015 at 10:13:46 AM GMT+3

Anyone using Cayenne with Informix?

2015-09-11 Thread Hugi Thordarson
Hi all. I’m starting work on a (somewhat technologically dated) project that uses Informix. I see it’s not on the list of officially supported DBs, just wondering if anyone has attempted to use it with Cayenne? - hugi

Re: Is there a canonical method of invoking aggregate functions

2015-09-14 Thread Hugi Thordarson
>> I've started working on a proposal for the WebObjects-world to migrate >> Project Wonder to Cayenne, > > Sounds great. Its been a long time since I was in the WO world, and although > I used Project Wonder way back then, I find it hard to remember where EOF > stopped and Wonder started.

Is there a canonical method of invoking aggregate functions

2015-09-12 Thread Hugi Thordarson
or is there a standard way to do this? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ <http://www.loftfar.is/> // s. 895-6688

Re: How to use Join Queries

2015-09-26 Thread Hugi Thordarson
Hi Deepesh! Disclaimer: Note my answer applies to Cayenne version 4.0 (it’s the only version I know and I don’t know the older APIs). I’m assuming you’re new to Cayenne and inherited an existing project. Cayenne maps a database to a java object graph, and using Cayenne you'll usually have a

Re: How to use Join Queries

2015-09-26 Thread Hugi Thordarson
If everything is modeled correctly, your “Person” class should have an “addresses” method that will return a List containing all related addresses. - hugi > On 26. sep. 2015, at 13:20, Dipesh Jain wrote: > > Hii Hugi > I am using Cayenne 3.1. You are assuming correctly. I

Re: Fetching distinct related objects

2015-09-22 Thread Hugi Thordarson
015, at 15:55, John Huss <johnth...@gmail.com> wrote: > > Sorry, I misunderstood. I assume you're actually including a qualifier or > where clause, not just fetching everything? > > On Tue, Sep 22, 2015 at 10:39 AM Hugi Thordarson <h...@karlmenn.is> wrote: > &

Re: Fetching distinct related objects

2015-09-23 Thread Hugi Thordarson
>> On Sep 22, 2015, at 5:36 PM, Hugi Thordarson <h...@karlmenn.is> wrote: >> >> Hi all, >> >> I’m trying to retrieve a list of distinct related objects. If I execute an >> EJBQL-query that looks like this… >> >> "select disti

Re: Fetching distinct related objects

2015-09-23 Thread Hugi Thordarson
- replacing the > relationship in SELECT clause with an alias, and let us know if that made a > difference: > > "select distinct s from Receipt receipt inner join receipt.shop s” Yes, this syntax works, thanks. Cheers, - hugi > Andrus > > >> On S

Fetching distinct related objects

2015-09-22 Thread Hugi Thordarson
ing around this the wrong way? How would you go about constructing a fetch for distinct related objects? Cheers, - hugi // Hugi Thordarson // http://www.loftfar.is/ // s. 895-6688

Re: Fetching distinct related objects

2015-09-22 Thread Hugi Thordarson
:29, John Huss <johnth...@gmail.com> wrote: > > selectQuery.setDistinct(true); > > On Tue, Sep 22, 2015 at 9:37 AM Hugi Thordarson <h...@karlmenn.is> wrote: > >> Hi all, >> >> I’m trying to retrieve a list of distinct related objects. If I execute an >

Re: Migrate Schema

2016-01-13 Thread Hugi Thordarson
FWIW, “Migrate schema” does not work for me either (using MySQL). Cheers, - hugi > On 12. jan. 2016, at 17:42, Gmail wrote: > > The fact that reverse engineering doesn't work leads me to think that the > modeler can't read the schema. Which seems to failing silently. I

Re: Ordering by date on a timestamp field

2016-06-09 Thread Hugi Thordarson
Hi Frank, we solved this in one of our apps by creating a separate date-only column in the DB and mapping it to java.time.LocalTime in our model class. Then we just modified the setter for the dateTime value to also set the date-only value. Cheers, - hugi // Hugi Thordarson // http

  1   2   3   >