Joseph Schmidt | 1 Apr 2009 21:15
Picon
Favicon

What 3rd party jars are a must?


The "lib/third-party" contains several jar files required as dependency.

http://cayenne.apache.org/doc/jar-files-and-dependencies.html
describes some of them but not all :(.

What about?:
asm-3.0.jar 
asm-commons-3.0.jar 
geronimo-jpa_3.0_spec-1.0.jar  ?

Are they required when using a "pure cayenne" server, i.e. no JPA?
(they were not required in Cayenne 2)

thanks,
Joseph.

Aristedes Maniatis | 2 Apr 2009 02:07
Picon
Favicon
Gravatar

Re: What 3rd party jars are a must?


On 02/04/2009, at 6:15 AM, Joseph Schmidt wrote:

> http://cayenne.apache.org/doc/jar-files-and-dependencies.html
> describes some of them but not all :(.
>
> What about?:
> asm-3.0.jar
> asm-commons-3.0.jar
> geronimo-jpa_3.0_spec-1.0.jar  ?
>
> Are they required when using a "pure cayenne" server, i.e. no JPA?
> (they were not required in Cayenne 2)

What makes you think these are required? They aren't in the  
documentation as required and the documentation is correct. Are you  
getting some error at runtime?

If you are reading the pom.xml, there are lots of dependencies in  
there which are required for compiling Cayenne or other reasons.

Ari

-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

(Continue reading)

Joseph Schmidt | 2 Apr 2009 12:26
Picon
Favicon

Re: What 3rd party jars are a must?


> > http://cayenne.apache.org/doc/jar-files-and-dependencies.html
> > describes some of them but not all :(.
> > 
> > What about?:
> > asm-3.0..jar
> > asm-commons-3.0.jar
> > geronimo-jpa_3.0_spec-1.0.jar  ?
> > 
> > Are they required when using a "pure cayenne" server,
> i.e. no JPA?
> > (they were not required in Cayenne 2)
> 
> What makes you think these are required? 
They were in the distribution :). Usually they include only what's really needed :).

> They aren't in the
> documentation as required and the documentation is correct.
OK. Thank you for the information :).
This statement is however quite seldom for open source projects (even for the most Apache.org ones :) ).

> Are you getting some error at runtime?
No, but those look like bytecode manipulation libs. 
Without them other open source projects would be e.g. slower, or some features would simply not work correctly.

But of course, the less dependencies and the smaller the jars, the better :).

Joseph.

(Continue reading)

Joseph Schmidt | 2 Apr 2009 12:51
Picon
Favicon

Re: Conditional relationship mapping?


> > This would sound cool to me too, but from the Cayenne
> documentation example, this approach seems to have the
> problem that Java has single inheritance :(.
> > 
> > If there's only one such table than it would work
> (single inheritance).
> > E.g. In the above example, by doing a superclass to
> point to the "tag" table(Tag entity), called "Taggable". All
> entities that would like to have "tag"s would just need to
> extend the "Taggable" entity.
> > 
> > The big problem is how to do it if there are more
> tables like that in the scheme :(.
> 
> Yes, you get to have exactly one Tag concept since you can
> have only one superclass. Otherwise you have to model this
> as an interface, but there is no support for that in
> Cayenne. 
This would have been my first choice too, but I saw no support in Cayenne Modeler for entering additional
interfaces - only one super class :(.

> >> Choice 2:
> >> Just do exactly what you are doing and fake the
> >> relationships. Subclass CayenneContext so that you
> can
> >> create the appropriate setters and getters to make
> this all
> >> work. We do this ourselves and I might be able to
> dig up
(Continue reading)

Dave Lamy | 2 Apr 2009 18:53
Picon

Quick query question

I am composing a SelectQuery and want to include an expression to narrow my
results based upon the primary key (just an int ID) as well as other
criteria.  I am using the ExpressionFactory to generate the Expressions..
specifically I have

Expression expr = ExpressionFactory.inExp(<pathToId?>, idCollection);

Question is:  How do I represent the path to the primary key in an
expression string like this?

Thanks--
Dave
Michael Gentry | 2 Apr 2009 19:01
Favicon

Re: Quick query question

Did you map your primary key as a Java attribute?  If so, just include it.

On Thu, Apr 2, 2009 at 12:53 PM, Dave Lamy <davelamy <at> gmail.com> wrote:
> I am composing a SelectQuery and want to include an expression to narrow my
> results based upon the primary key (just an int ID) as well as other
> criteria.  I am using the ExpressionFactory to generate the Expressions..
> specifically I have
>
> Expression expr = ExpressionFactory.inExp(<pathToId?>, idCollection);
>
> Question is:  How do I represent the path to the primary key in an
> expression string like this?
>
> Thanks--
> Dave
>

Dave Lamy | 2 Apr 2009 19:06
Picon

Re: Quick query question

No, I didn't.. just did the standard Cayenne mapping with a database ID
column (auto-generated) which of course is not exposed in the Java class.
What makes this even more fun is that I'm using a generic persistent class
in several cases, so I don't have concrete Java classes/paths to work with.
Was hoping to use some sort of pseudo-path like Hibernate's ".id" field in
hql.

So far the only real solution to this that I can see is to use a consistent
PK column naming scheme.. like "ID".. and then use a db:ID path expression.
But it's not ideal.

On Thu, Apr 2, 2009 at 12:01 PM, Michael Gentry <mgentry <at> masslight.net>wrote:

> Did you map your primary key as a Java attribute?  If so, just include it.
>
>
> On Thu, Apr 2, 2009 at 12:53 PM, Dave Lamy <davelamy <at> gmail.com> wrote:
> > I am composing a SelectQuery and want to include an expression to narrow
> my
> > results based upon the primary key (just an int ID) as well as other
> > criteria.  I am using the ExpressionFactory to generate the Expressions..
> > specifically I have
> >
> > Expression expr = ExpressionFactory.inExp(<pathToId?>, idCollection);
> >
> > Question is:  How do I represent the path to the primary key in an
> > expression string like this?
> >
> > Thanks--
> > Dave
(Continue reading)

Andrey Razumovsky | 2 Apr 2009 20:30
Picon

Re: Quick query question

This is possible. See http://cwiki.apache.org/CAY/mapping-primary-keys.html
Also, as far as I know new modeler has checkbox option for auto-generating
primary key attrs at reverse-engineering

2009/4/2 Dave Lamy <davelamy <at> gmail.com>

> No, I didn't.. just did the standard Cayenne mapping with a database ID
> column (auto-generated) which of course is not exposed in the Java class.
> What makes this even more fun is that I'm using a generic persistent class
> in several cases, so I don't have concrete Java classes/paths to work with.
> Was hoping to use some sort of pseudo-path like Hibernate's ".id" field in
> hql.
>
> So far the only real solution to this that I can see is to use a consistent
> PK column naming scheme.. like "ID".. and then use a db:ID path expression.
> But it's not ideal.
>
> On Thu, Apr 2, 2009 at 12:01 PM, Michael Gentry <mgentry <at> masslight.net
> >wrote:
>
> > Did you map your primary key as a Java attribute?  If so, just include
> it.
> >
> >
> > On Thu, Apr 2, 2009 at 12:53 PM, Dave Lamy <davelamy <at> gmail.com> wrote:
> > > I am composing a SelectQuery and want to include an expression to
> narrow
> > my
> > > results based upon the primary key (just an int ID) as well as other
> > > criteria.  I am using the ExpressionFactory to generate the
(Continue reading)

Dave Lamy | 2 Apr 2009 20:36
Picon

Re: Quick query question

Thanks guys.

I'm actually in the middle of putting together some code that will grab the
ObjEntity and use the getPrimaryKeyNames() method to get the name of the
PK.. then just create the expression using "db:" + pkName.  I'll let
everyone know how that goes.. if not great then I can back up to use this
instead.

Dave

On Thu, Apr 2, 2009 at 1:30 PM, Andrey Razumovsky <
razumovsky.andrey <at> gmail.com> wrote:

> This is possible. See
> http://cwiki.apache.org/CAY/mapping-primary-keys.html
> Also, as far as I know new modeler has checkbox option for auto-generating
> primary key attrs at reverse-engineering
>
> 2009/4/2 Dave Lamy <davelamy <at> gmail.com>
>
> > No, I didn't.. just did the standard Cayenne mapping with a database ID
> > column (auto-generated) which of course is not exposed in the Java class.
> > What makes this even more fun is that I'm using a generic persistent
> class
> > in several cases, so I don't have concrete Java classes/paths to work
> with.
> > Was hoping to use some sort of pseudo-path like Hibernate's ".id" field
> in
> > hql.
> >
(Continue reading)

Bryan Lewis | 3 Apr 2009 21:50
Picon
Gravatar

pruning the querylogger

This might be an obvious question but I couldn't find it in the list and docs.

In our old Cayenne-2-based apps, we selectively pruned the query
logging to avoid cluttering our log files with uninteresting
repetitive queries.  We used QueryLogger.setLoggingLevel() before each
performQuery().  Yeah, it was a bit tedious and I'm not surprised to
see setLoggingLevel() has gone away.  But if we still want to prune
the logging, how do we do it?

Thanks.


Gmane