I'm using 3.0M6 with SQLite v056. In DBLoader.java, line 408, the loader
is trying to check if the table is named correctly using
String.equals(), but the SQLite metadata is returning the table name in
uppercase, and it's defined in the map in lowercase.
Can equals() be replaced with equalsIgno
I'm assuming you mean bitwise? Cayenne Expressions ultimately boil down
to SQL, so it should be possible to create such an expression for
databases that support bitwise boolean operations. You may want to try
Expression.fromString():
http://cayenne.apache.org/doc20/building-expressions.html
-
You should be able to, theoretically, use a scripted data source to pull
in data through your CDOs. It really does seem pointless though, since
you're just doing SELECT queries, and those are pretty standard. I think
it would be more work to write the scripted data sources than to just
write a cann
Incidentally, you can load the JDBC driver at runtime; you don't have to
have it on the CP. You'll have to wrap it with a shim loaded by the
system CL, though, because DriverManager will choke on the non-system
CL, for whatever reason. http://www.kfu.com/~nsayer/Java/dyn-jdbc.html
Toss the shim'd
If you google for a comparator for version numbers/SNMP OIDs, you can
find Java classes to do this. If you're guaranteed to always have
exactly three fields, the slickest way would be to change the schema.
Regards,
Scott
-Original Message-
From: Adrian Wiesmann [mailto:[EMAIL PROTECTED]
I had a similar issue back in April in the past. I believe you can work
around this limitation by committing the parent of the relationship (the
"one" of the "one-to-many") before committing the children (the "many").
http://cayenne.markmail.org/message/6nazm7w4kaxxhj7m
-Original Message-
at was a
common issue I saw at the time. Just curious, can you leave the
session open at all times in a multithreaded web application? What
happens if you leave it open and the user doesn't come back?
On Wed, Nov 12, 2008 at 2:24 PM, Scott Anderson <[EMAIL PROTECTED]>
wrote:
>
Minor nit-pick, Michael: there's nothing in Hibernate preventing you
from leaving a session open at all times, treating the session as a
context, so your assertion that it is less intuitive for that reason is,
perhaps, unfair. Of course, Hibernate is indeed less intuitive, but not
for that reason.
Mike,
You may change the PK generation strategy at runtime.
http://markmail.org/message/kwyfw3e7pguwle47
-Scott
-Original Message-
From: Michael Shea [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 21, 2008 10:12 AM
To: user@cayenne.apache.org
Subject: Re: Talking to multiple database
I'm working on a path to add generated PK support to SQLite, but I've
come across an issue with commit() - for some reason, autocommit is on,
but Cayenne is still trying to call commit(), which causes an exception.
An effective workaround is to re-check getAutoCommit() in
ConnectionWrapper.commit()
Someone asked a similar question before - the clever solution was to map
the field in the modeler as if it were part of a separate table.
-Original Message-
From: Pierre Lavignotte [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2008 12:26 PM
To: user@cayenne.apache.org
Subject: How
tSet.getInt("DELETE_RULE") and
fetched result set.
Could you tell some more about your situation, for error message doesn't
seem to describe it properly.
BTW, I'd be very cautious with setting delete rules both in DB and
Cayenne.
In most cases Cayenne rule is enough i think
2008/
Does anyone know if it's possible to get information about existing
relationships' UPDATE/DELETE rules via JDBC? Looks like the DELETE rule on my
Derby database isn't in sync with what Cayenne thinks it is, but the merger
isn't checking that.
Foreign Key 'SQL081001165758000' is invalid because
I don't think that slapping a "priority" on to the end of a table can
pass for a solution. In order for the approach to meet the efficiency
requirements, the width of the priority field would have to be 1 + the
maximum unsigned value of the PK field, or else the field could run out
of granularity.
Cayenne is there to abstract the interface to the tools that the
database provides, not to obfuscate the tools. Custom ordering is not an
intrinsic attribute of a relationship in the database; it should not be
an intrinsic attribute of a relationship in Java.
If you need to sort the results or a J
If you put a new entry in the middle of the list, it's still going to
boil down to a vanilla INSERT. Since DB tables are FIFO, your row will
jump to the end of the list the after a refresh.
If order is important to your application, you'll have to come up with a
way that the database will respect.
I'm not familiar with MSSQL, but in MySQL that's definitely the case - both
database and table visibility are opt in, not opt out.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Øyvind Harboe
Sent: Thursday, September 25, 2008 4:16 AM
To: user@cayenne.ap
That method is defined in the DbAdapter interface; you don't need to cast it.
See MySQLMergerFactory (post CAY-1108 patch) for an example.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Øyvind Harboe
Sent: Thursday, September 25, 2008 3:55 AM
To: [EMAIL
> I just thought maybe there could have been something similar to
> hibernate4gwt in the hibernate land. Maybe I could work on something.
I certainly don't want to crush any aspirations to enhance the
development experience, but I want to make sure that you're not trying
to reach an unreachable go
> > For schema, do you intend the db schema?
> > > > If it is,
> > > >
> > > > well, this is the CREATE statement generated by modeler for
hsqldb:
> > > >
> > > > CREATE CACHED TABLE Canvass (id BIGINT NOT NULL, title
VA
> Null value for 'id'.
Is id set to NULL in the schema, but MANDATORY in the Cayenne map? I'm
not sure if I'm interpreting the error correctly, but it sounds like
Cayenne sees a NULL where it doesn't expect one.
This topic has been discussed in this group before, but I'll reiterate
the general concepts. You can't serialize persistent objects, period.
There are many reasons why, but I don't have time to list them all, so
here are the three that are most important in my mind.
Reason #1:
In order for the GWT
Disregard the previous email, I spoke too soon. This is looking like a
bug in the MySQL/J driver; it's reporting the field as nullable when it
isn't.
-Original Message-----
From: Scott Anderson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 12, 2008 3:40 PM
To: user@cayenne.
M
To: user@cayenne.apache.org
Subject: Re: DbMerger/MySQL compatibility
On Aug 28, 2008, at 21:03, Scott Anderson wrote:
>> Is it possible to detect this via jdbc?
>
> A rather long-winded way to detect table type is:
> SHOW CREATE TABLE [table name];
>
> This will return th
Woops, hit send too soon on the last email
> Can you try with the latest build?
> http://hudson.zones.apache.org/hudson/job/Cayenne-
> trunk/lastBuild/org.apache.cayenne$cayenne-modeler-java/
Nope; it's not fixed in the latest nightly. Additionally, the same
problem we discussed the other day in
> Can you try with the latest build?
> http://hudson.zones.apache.org/hudson/job/Cayenne-
> trunk/lastBuild/org.apache.cayenne$cayenne-modeler-java/
Nope; it's not fixed in the latest nightly. Additionally, the same
problem we discussed the other day in regards to Derby is occurring:
ALTER TABLE m
ilto:[EMAIL PROTECTED]
Sent: Thursday, August 28, 2008 2:07 PM
To: user@cayenne.apache.org
Subject: Re: DbMerger/MySQL compatibility
On Aug 28, 2008, at 19:34, Scott Anderson wrote:
> It looks like the DbMerger in 3.0M4 isn't properly detecting whether
> NULL is allowed for columns when
It looks like the DbMerger in 3.0M4 isn't properly detecting whether
NULL is allowed for columns when using MySQL. Is this another issue that
has already been fixed in trunk?
Does it seem reasonable to expect the MySQL adapter to know that MyISAM
doesn't support db-enforced FKs? I don't have the a
After switching over to using the DbGenerator and DbMerger from flat SQL
files, I see this to be of fairly major importance. Since the database
doesn't know what default values should be, I'm finding myself reworking
a fair amount of code to add these where it wouldn't otherwise be
necessary.
For
> I'm leaning towards leaving this in the application domain
I'd have to agree here; schema changes should always be touched by human
eyes, but the only way to do that effectively is at the application
level.
L PROTECTED]
Sent: Tuesday, August 26, 2008 2:30 PM
To: Scott Anderson
Subject: Re: DbGenerator vs. MergeContext
On Aug 26, 2008, at 19:25, Scott Anderson wrote:
> Are there any examples of how to do this in code? It would be nice to
> have Cayenne do all the heavy lifting here, since the idea o
Sounds like you want to make the field NOT NULL with a default value in the
database. That would transparently do what you've described, without any
reliance on Cayenne.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Øyvind Harboe
Sent: Wednesday, Augus
One really hacky but effective way to do this would be to override the
class loader to log where the classes are coming from - after you filter
for your package of course. You'll be able to mine a full stack trace in
addition to the actual location of the class file.
-Original Message-
Fro
Here's what my mapping file looks like:
...
-Original Message-
From: Joe Baldwin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 08, 2008 10:47 AM
To: user@cayenne.apache.org
Subject: CayenneModeler: "Superclass Package
Where is the CayenneModeler attribute "Superclass
In my experience, this generally means you've created an invalid state
in the object model. You might try nullifying any relationships that the
object has before deleting it, since I can't remember if Cayenne will do
that for you - I believe that relationships are marked ON DELETE
RESTRICT by defau
the xml file and then
calling:
Class.forName("com.mysql.jdbc.Driver");
before calling :
context = DataContext.createDataContext();
worked like a charm. I'm now able to start actually using this thing. :)
-j
On Jul 1, 2008, at 1:51 PM, Scott Anderson wrote:
> Jerald
Jerald,
If this is a similar ClassLoader issue, you can try explicitly sending a
(String)null to Cayenne for the driver name, forcing it to go through
the DriverManger, with which you will register your JDBC driver.
I have a similar situation in one of my applications, except that I am
forcing Ca
July 1, 2008 10:49:20 AM CDT
> To: "Scott Anderson" <[EMAIL PROTECTED]>
> Cc: "Andrus Adamchik" <[EMAIL PROTECTED]>
> Subject: Re: Exception in SAXParserFactory.newInstance with 3.0M4
>
> Thats interesting. Here is my drive.xml file:
>
>
>
Within a given context, unique database rows exist as unique objects. You could
cache these objects with strong references, which would prevent them from being
GC'd.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Øyvind Harboe
Sent: Monday, June 30, 200
If I'm not mistaken, using an incomplete SQLTemplate statement will allow
fetching of incomplete DataObjects, and Cayenne will not go back to the
database again until you try to access unfetched data.
At least, that's what I remember the behavior being; SELECTs occurred when I
stopped at a brea
Sent: Friday, June 20, 2008 3:42 PM
To: user@cayenne.apache.org
Subject: Re: weakly referenced paged queries
On Fri, Jun 20, 2008 at 7:34 PM, Scott Anderson <[EMAIL PROTECTED]> wrote:
> It looks like the synchronized block is designed to prevent concurrent
> modification
>
It looks like the synchronized block is designed to prevent concurrent
modification of the list. I don't believe that particular code would suffer the
consequences if concurrent modification occurred, but it's generally best to
synchronize list access when in doubt, since even a simple iteration
I use a custom DSF for different reasons, but this might help anyways:
http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/db/conf/Cay
enneConfiguration.java
It's not as well documented as Andrus' example, but hopefully it's a
little more obvious what it's doing.
-Original Message---
Can anyone help with this?
-Original Message-
From: Scott Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 12, 2008 1:04 PM
To: user@cayenne.apache.org
Subject: Expression question
What would be the best way to construct an expression which asserts that
a flattened many-to-many
What would be the best way to construct an expression which asserts that
a flattened many-to-many relationship has no entries? Looking at methods
in ExpressionFactory, nothing jumps out at me. I'm looking for rouged
items in a hierarchy.
Thanks,
Scott
queries will do what you need?
http://cayenne.apache.org/doc12/paginated-queries.html
On Thu, Jun 5, 2008 at 4:00 PM, Scott Anderson <[EMAIL PROTECTED]>
wrote:
> I've seen the setFetchLimit(int) method, but I'm wondering if there's
a
> way to set a starting ro
I've seen the setFetchLimit(int) method, but I'm wondering if there's a
way to set a starting row as well, short of using a SQLTemplate or the
like.
anyone use these
classes like I'm suggesting? Anyway, let me know and thanks again for
the input!
--
Jon
Jon Sharp
CTO & Senior Engineer
Campground Automation Systems, Inc.
[EMAIL PROTECTED]
(615) 579-5868
www.campgroundautomation.com
On May 28, 2008, at 3:13 PM, Scott Anderson w
Message-
From: Scott Anderson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2008 4:05 PM
To: user@cayenne.apache.org
Subject: RE: Cayenne and JAX-WS / JAXB
Jon, what is the reason you wish to do this? What you're proposing
breaks the whole point of making a layer out of persistence;
Jon, what is the reason you wish to do this? What you're proposing
breaks the whole point of making a layer out of persistence; it is taboo
to even speak of serializing your persistence layer in any direction
other than to or from the database, which is what Cayenne does for you.
Consider what migh
I've heard rumors of properties for Java 7 -- if you've ever used VB6
classes, you probably have a good idea of what that means; think of a
public member which may have read-only, write-only, or read-write access
-- which would cause the deprecation of getters/setters.
Scott
-Original Message
I have a feeling this may turn out to be a stupid question, but here
goes anyways:
Is there a good way to cleanly shut down Cayenne? Have deployed my web
app containing Cayenne to a tomcat server; this works great, until I try
to undeploy or redeploy a new WAR. Tomcat fails to delete
WEB-INF/li
Re: one-to-many problem
Sorry I didn't have a chance to investigate this more deeply. I think
you can also tag both columns as a compound PK.
Andrus
On May 16, 2008, at 11:28 AM, Scott Anderson wrote:
> I was able to work around this by removing command.id from the model
> and
>
n why the way I had it shouldn't work.
-Original Message-----
From: Scott Anderson [mailto:[EMAIL PROTECTED]
Sent: Monday, May 12, 2008 6:25 PM
To: user@cayenne.apache.org
Subject: one-to-many problem
I've got a table `command which has:
`id` int PK
`name` varchar(32
Also worth noting: I still can't seem to crack my original problem. Can
anyone reproduce it?
-Original Message-
From: Scott Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 13, 2008 5:16 PM
To: user@cayenne.apache.org
Subject: RE: one-to-many problem
That makes sense, but I
one.
We don't want to assign one. We want it to pick up the existing
value and reuse it.
Hope this helps explain dependent primary keys better.
On 5/12/08, Scott Anderson <[EMAIL PROTECTED]> wrote:
> Seems like a pointless annotation; vaguely equivalent to t
retrospect it won't work because command.name isn't a pk.
http://cayenne.apache.org/doc12/to-dep-pk-checkbox.html should explain
it fairly well.
On 5/12/08, Scott Anderson <[EMAIL PROTECTED]> wrote:
> Can't check the box. Can you explain what that does? I read the
> doc
rg
Subject: Re: one-to-many problem
One thing you could try is to make command.name -> command_alias.name
to-dependent-key=true if it's not already set that way. Don't know if
it'll help, though.
On 5/12/08, Scott Anderson <[EMAIL PROTECTED]> wrote:
> I've got a ta
I've got a table `command which has:
`id` int PK
`name` varchar(32) UNIQUE
and a table `command_alias` which has
`alias` varchar(32) PK
`name` varchar(32) FK REF `command`.`name`
Take special note how `command_alias`.`name` is a FK to `command`.`name`
(unique field
t: Re: Query.setRefreshingObjects(boolean)
You don't have to declare the throw clause if it's a RuntimeException.
The method signature doesn't have to change.
On 5/5/08, Scott Anderson <[EMAIL PROTECTED]> wrote:
> > I don't see
> > much benefit to providing a binary-c
Works great; thanks Andrus.
-Original Message-
From: Andrus Adamchik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 06, 2008 4:30 AM
To: user@cayenne.apache.org
Subject: Re: Specifying PK when creating a new object in DB generated PK
mode
How about using a brute force approach. You have a
> I don't see
> much benefit to providing a binary-compatible method API that does
> nothing.
...
> Another possibility is to @deprecate the method and have it
> unconditionally throw a RuntimeException telling the developer to
> rewrite using query cache options.
Adding a Throws clause to the met
I was looking through my old emails, and I realized that I still haven't
found a resolution to this. Andrus vaguely mentioned that there might be
a good reason why you aren't allowed to, but I wasn't able to find that
reason.
So, to recap, here's my scenario:
I am normalizing the schema for a req
]
Sent: Sunday, April 13, 2008 12:11 PM
To: user@cayenne.apache.org
Subject: Re: Generalized DB editor
Hi Scott,
Have you considered using getTargetEntity on ObjRelationship?
--
Kevin
On Apr 11, 2008, at 11:02 PM, Scott Anderson wrote:
> Hello,
>
> I'm trying to write a gene
Hello,
I'm trying to write a generic editor for CayenneDataObjects. ObjAttributes are
pretty straightforward, but I'm not clear on the best way to handle
ObjRelationships. Basically, what I want to know is how to take a
ObjRelationship and turn it in to a Class
representing the target type's c
me to NULL. 'getConnection' method then will consult
DriverManager and return the driver you specified.
Could you check that it works for you?
Thanks
Andrus
On Apr 4, 2008, at 7:58 PM, Scott Anderson wrote:
> I am using a special wrapper around my Driver so that I don't n
Hi all,
I've got a many-to-many relationship. For one object, I'm trying to
clear all of the entries in the relational table, and then re-add them
BEFORE doing a commit. If I do this, Cayenne tries to do an INSERT and
then a DELETE, but this fails since the relational table has both fields
as P
I am using a special wrapper around my Driver so that I don't need to
have the jar on the classpath. This trick clashes with the
DriverDataSource class. Instead of failing immediately if the class
doesn't exist, it might be prudent to check with the
java.sql.DriverManager first - or, heck, even go
Subject: Re: How can I customize the driver/url/login
> I'm using a custom DataSourceFactory now;
So how does this code look like? There's something in the DataSource
it returns that results in the errors you've mentioned.
Andrus
On Apr 3, 2008, at 7:18 PM, Scott Anderson wro
it returns that results in the errors you've mentioned.
Andrus
On Apr 3, 2008, at 7:18 PM, Scott Anderson wrote:
> I'm using a custom DataSourceFactory now; if I switch it back to
> DriverDataSourceFactory and set the minimum connections to 2, Derby
> complains a
sing a custom DataSourceFactory now;
So how does this code look like? There's something in the DataSource
it returns that results in the errors you've mentioned.
Andrus
On Apr 3, 2008, at 7:18 PM, Scott Anderson wrote:
> I'm using a custom DataSourceFact
ROTECTED]
Sent: Thursday, April 03, 2008 12:01 PM
To: user@cayenne.apache.org
Subject: Re: How can I customize the driver/url/login
Just for kicks, bump up your minimum DB connections in the modeler and
see what happens ...
On Thu, Apr 3, 2008 at 11:37 AM, Scott Anderson <[EMAIL PROTECTED]
itely something Derby-related.
Googling the exception shows quite a few hits. Which connection pool
you end up using anyways? The built in Cayenne version?
Andrus
On Apr 3, 2008, at 6:13 PM, Scott Anderson wrote:
> Awesome; that's exactly what I was looking for.
>
> I'
DB info on first call, or do whatever is appropriate in
your case.
Cheers,
Andrus
On Apr 3, 2008, at 3:38 AM, Scott Anderson wrote:
> Is there a way I can customize the driver/url/login information
> through
> my application code? I want the user to be able to select the location
> and
Is there a way I can customize the driver/url/login information through
my application code? I want the user to be able to select the location
and login credentials, but the schema is known. I don't want the user to
have to write his or her own configuration files and repackage the
distributed jar,
I'm not sure if this will help, but I've got Cayenne running in a CXF Web
Service container, and I'm using a custom in-house JavaScript webkit to do AJAX
calls.
One interesting quirk of my project is that, because CXF can't bind to the same
port as the web server, and because some web browsers
, 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 row-level ch
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
Message-
From: Michael Gentry [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2008 3:52 PM
To: user@cayenne.apache.org
Subject: Re: Get the number of FKs
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 PROTE
;
> > With this code, though, be careful that you don't have any of
> those > dangling employees in memory, as this totally bypasses the
> Cayenne > object graph.
> >
> > /dev/mrg
> >
> >
> >
> > On Thu, Mar 6, 2008
an SQLTemplate.
I wouldn't bother with the intermediate step of fetching how many
employees are in the list -- I'd simply pull back all departments that
have no employees since you're planning on deleting them anyway, or at
least department primary keys.
On 3/6/08, Scott Anderson &
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'
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
Calender.getTime() returns a Date, which doesn't have any concept of a timezone
other than the one you are in. You probably are going to have to get the
timezone's offset from GMT and convert it yourself. I've had to do this in the
past, so you're welcome to learn from my mistakes: take a look a
f I understand right, you could probably use the same kind of
relationship to make the pk of REQUESTS be dependent on the REQUESTS_OLD
pk, avoiding all of this code.
On Wed, Feb 20, 2008 at 3:27 PM, Scott Anderson <[EMAIL PROTECTED]>
wrote:
> Here's my exact scenario:
>
> requ
nerated PK
mode
Hmm... then I suspect a bug in handling that in DB-generated PK mode.
We may need to reopen CAY-987, now that the scenario is clarified.
Andrus
On Feb 20, 2008, at 9:53 PM, Scott Anderson wrote:
> I am using this function, and the latest changes from SVN:
>
> pu
Tom,
Take a look at the Cayenne Modeler; there is a feature to "Reengineer
Database Schema" on the tools menu. You may be unable to do this with
standard user-level permissions, depending on your database type and
configuration. Then you'll be able to generate the POJOs which should
resemble quite
AFAIK the approach above should work.
Andrus
On Feb 20, 2008, at 8:31 PM, Scott Anderson wrote:
> It looks like there's no model that fits what I'd like to do. IMO, the
> user should be able to specify the PK in DB-generated mode when either
> the field is exposed, or the PK
;s
responsibility to enforce PK integrity.
-Original Message-
From: Aristedes Maniatis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 20, 2008 2:01 AM
To: user@cayenne.apache.org
Subject: Re: Specifying PK when creating a new object in DB generated PK
mode
On 20/02/2008, at 9:51 AM,
I am working an a request ticket system, similar to the one I'm using to
enter this issue. I need to import requests from the old schema to the
new schema, and the PKs must be specified while doing an import. When
using the tool normally, the PKs must be database generated. Is there
any way to do t
90 matches
Mail list logo