you do this on the database level, when creatig the tables, by defining the
foreign keys to be mandatory. e.g. NOT NULL
the exact syntax depends on your database. cayenne picks up these constraints
and checks the values to be set before committing.
Roja Buck <[EMAIL PROTECTED]> wrote:
All,
For primary key, you can use
"db:" + YourEntity._PK_COLUMN
For a foreign key, you could do the same, but it'd be cleaner to use
the objRelationship name.
On 3/23/07, Michael Lepine <[EMAIL PROTECTED]> wrote:
In my application, I have a few queries that I've created with the
SelectQuery class.
I think you have to manually map the fk/pk as an attribute. then cayenne knows
the field for ordering.
when reverse engineering a database cayenne does not create attribute mappings
for pks and fks.
Michael Lepine <[EMAIL PROTECTED]> wrote:
In my application, I have a few queries that I've crea
The mandatory nature of the relationship is based on the mandatory
nature of the underlying DB attributes.
Ie, if PAINTING.ARTIST_ID is mandatory, then the relationship
Painting.artist is also mandatory and must not be null.
On 3/23/07, Roja Buck <[EMAIL PROTECTED]> wrote:
All,
I am a littl
In my application, I have a few queries that I've created with the
SelectQuery class. In some instances, I'd like to order the results by the
primary or foreign keys in the table using the addOrdering() method. I have
not found a way to do this. I believe I get an error that the column does
not ex
All,
I am a little new to databases so I apologise if this query is
particularly incompetent. I have created a series of tables all of which are
related to one central table with that central table having relations of one
to many with the rest of the tables. The problem I have however is that I
Thanks Mike, that did the trick.
List list = context.performQuery(query);
Map row = (Map)list.get(0);
String cnt = row.get("cnt").toString();
Regards,
Frank
- Original Message -
From: "Mike Kienenberger" <[EMAIL PROTECTED]>
To:
Sent: Friday, March 23, 2007 11:13 AM
Subject: Re: How d
Sounds right. I haven't used named queries so I wasn't aware of how
they are configured. If that's the case, what sql output do you see
in the logs?
Here's some sample code that might be helpful. It doesn't do quite
the same thing, but it's pretty close in structure and data returned.
pri
Fetch DataObjects is unchecked.
Does this default to fetch DataRows?
Frank
- Original Message -
From: "Mike Kienenberger" <[EMAIL PROTECTED]>
To:
Sent: Friday, March 23, 2007 11:01 AM
Subject: Re: How do I return a record count?
Did you set the query to fetch DataRows (Maps) instea
Did you set the query to fetch DataRows (Maps) instead of DataObjects
(Entities)?
On 3/23/07, Frank <[EMAIL PROTECTED]> wrote:
Hello,
I have a named query defined as:
SELECT COUNT(ticketId) AS cnt FROM tickets
WHERE ticketClosed = 0
This is not working, how do I get the count returned?
NamedQue
Hello,
I have a named query defined as:
SELECT COUNT(ticketId) AS cnt FROM tickets
WHERE ticketClosed = 0
This is not working, how do I get the count returned?
NamedQuery query = new NamedQuery("openTicketsQuery");
List records = context.performQuery(query).;
String cnt = records.get(0).toString()
Hi Prashant,
Note that Cayenne user support is done via the mailing list, as it
allows us to better share the community knowledge. I am ccy'ing the
question to the list. Please feel free to continue this discussion on
the list:
http://cayenne.apache.org/mailing-lists.html
On Mar 23, 200
12 matches
Mail list logo