Or just filter logs with 'grep'.
Andrus
On Mar 7, 2008, at 12:36 AM, Aristedes Maniatis wrote:
On 07/03/2008, at 8:10 AM, Scott Anderson wrote:
Is there a way to tell Cayenne to log only INSERT, UPDATE, and DELETE
operations? In the production database, we have triggers that record
each ro
On 07/03/2008, at 8:10 AM, Scott Anderson wrote:
Is there a way to tell Cayenne to log only INSERT, UPDATE, and DELETE
operations? In the production database, we have triggers that record
each row-level change in a shadow table, and I want to profile my code
to keep these operations to a minimu
Is there a way to tell Cayenne to log only INSERT, UPDATE, and DELETE
operations? In the production database, we have triggers that record
each row-level change in a shadow table, and I want to profile my code
to keep these operations to a minimum, but it's hard to do with 90% of
the console output
Yes; I think I figured out how to do the SQLTemplate.
SQLTemplate sqt = new SQLTemplate(Department.class, "SELECT DISTINCT " +
"#result('department.idx' 'int' 'idx') " +
"FROM department " +
"LEFT JOIN user ON department.idx = user.department_idx
" +
Just about like that? :)
String sql =
"SELECT DISTINCT #result('department.idx' 'Integer' 'idx') FROM
department LEFT JOIN user ON department.idx = user.department_idx
WHERE user.idx IS NULL";
SQLTemplate template = new SQLTemplate(Department.class,sql);
List departments =
DataContext.get
Does that SQL return all of the department PKs you want to delete?
On Thu, Mar 6, 2008 at 3:50 PM, Scott Anderson <[EMAIL PROTECTED]> wrote:
> How would I build a SQLTemplate to do a query like this one?
>
> SELECT DISTINCT department.idx
> FROM department
> LEFT JOIN user ON department.idx = u
How would I build a SQLTemplate to do a query like this one?
SELECT DISTINCT department.idx
FROM department
LEFT JOIN user ON department.idx = user.department_idx
WHERE user.idx IS NULL
-Original Message-
From: Michael Gentry [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 3:34
Unfortunately, that doesn't produce SQL with the proper JOIN type:
SELECT DISTINCT t0.idx, t0.manager_idx, t0.name FROM department t0, user
t1 WHERE t0.idx = t1.department_idx AND (t1.idx IS NULL)
In a one-to-many (one department, many users) relationship, this query
doesn't make any sense, so
You are right. I completely misread that. I'd still probably do raw
SQL or an SQLTemplate, though.
Thanks,
/dev/mrg
On Thu, Mar 6, 2008 at 3:31 PM, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
> Michael, just to clarify, he doesn't want to work with Employees. He
> wants to work with Departm
Michael, just to clarify, he doesn't want to work with Employees. He
wants to work with Departments. Scott wants to know how to do this
without pulling in the Employee records.
On 3/6/08, Michael Gentry <[EMAIL PROTECTED]> wrote:
> If it is mandatory, it sounds like these records were created ou
I haven't tried it, but I would think that if anything were going to
work out of the box, it would be
expression =
ExpressionFactory.matchExp(Department.EMPLOYEE_LIST_RELATIONSHIP_PROPERTY,
null);
Department.EMPLOYEE_LIST_RELATIONSHIP_PROPERTY may be named
differently in your generated classes
If it is mandatory, it sounds like these records were created outside
of Cayenne (they are legacy, testing, etc records)? If that is the
case, the easiest thing to do is to just issue an SQL command directly
to the database (using whatever normal SQL command you use).
Something like:
delete from
Ok thanks for the info Andrus. Have been just writing a
TransactionFilter for Click, and just wanted to know whether this was
possible. Not something I would actually use.
regards Malcolm Edgar
On Fri, Mar 7, 2008 at 5:45 AM, Andrus Adamchik <[EMAIL PROTECTED]> wrote:
> If the goal is to reuse t
Employee.Department is mandatory; I want to search for and delete rogue
departments.
-Original Message-
From: Michael Gentry [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 2:08 PM
To: user@cayenne.apache.org
Subject: Re: Get the number of FKs
It seems you mainly want a list of
It seems you mainly want a list of employees who are not in a
department, so doing a fetch on Employee where "department = null"
might work (I'm not positive I've ever tried this, but it seems
logical to me).
/dev/mrg
On Thu, Mar 6, 2008 at 1:58 PM, Scott Anderson <[EMAIL PROTECTED]> wrote:
> I'v
I've got a one-to-many relationship (employees belong to a department),
and I'd like to search for departments that have no employees.
Currently, I have something like:
foreach(dept : departments) {
if(dept.getEmployees().size() == 0)
context.deleteObject(dept);
}
When I do this, it
If the goal is to reuse the same transaction between requests, I'd
suggest using some other transaction manager (Spring? J2EE? I never
tried cross-request transactions, not sure what solution is the best).
For Cayenne to play nicely with it, check "Container Managed
Transactions" in the Mod
Model metadata is available through the ObjEntity, ObjAttribute,
ObjRelationship, DbEntity, DbAttribute, and DbRelationship classes.
Typically, you would use an EntityResolver to get the appropriate
object you wish to work with. For 3.0, you can use
[Data/Object]Context.getEntityResolver() to ac
All of the meta-data is stored in the obj entity (and the dbentity).
So, something like:
obj.getObjEntity().getAttributes(); //return attribute (non-
relationship properties)
obj.getObjEntity().getRelationships();//return relationships (1-1, 1-
many, etc.)
You can get the property names from t
In the DataObject, there is readProperty and writeProperty, but there
does not appear to be a method to get the names of the available properties.
I could hack around this limitation by creating a custom superclass for
my CayenneDataObject instances,
but WHY is there no getPropertyNames method? I
If it's unavaliable on web, can someone please email it to me?)
Yes it is available:
http://cayenne.apache.org/code-repository.html
Ahmed.
If it's unavaliable on web, can someone please email it to me?)
The scenario I am talking about is where you have a
client which only has access to certain records in a table, so when
the query the table they should only see their records.
This scenario is so common that I wonder why aren't there many out of the
box generic solutions.
I know this can be d
Can Cayenne Transactions be stored in a HttpSession?
regards Malcolm Edgar
Hi Adrian,
thanks for the feedback.
regards Malcolm Edgar
On Thu, Mar 6, 2008 at 6:14 PM, Adrian Wiesmann <[EMAIL PROTECTED]> wrote:
> Hello Malcolm, hello list
>
>
> > Does anyone have any good Cayenne patterns for applying data security
> > in queries. The scenario I am talking about is whe
Hi Mary-Anne,
Sorry for not answering your question, but rather giving you a big
picture on the state of DV technology. DataViews support has always
suffered due to the lack of volunteers to develop it, and finally got
dropped in Cayenne 3.0 [1]. DV in Cayenne 2.0 is documented here [2]
(
Nice! I haven't evaluated it yet (which I will do soon), but I am very
much in favor of the direction taken - integration of the existing
Modeler with Eclipse (vs. writing a Cayenne plugin from scratch, as
was attempted during 2006 Summer of Code IIRC).
Thanks,
Andrus
On Mar 6, 2008, at 4:
27 matches
Mail list logo