Re: Select Query on Table with no Primary Key

2007-06-07 Thread Andrus Adamchik
On Jun 8, 2007, at 7:01 AM, Craig L Russell wrote: Just FYI, when JDO reads data from tables without PK, it internally creates a unique id, similar to a generated PK, for the objects that it reads and these ids are discarded when no longer needed. The fact that the mapping is for tables wi

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Craig L Russell
Just FYI, when JDO reads data from tables without PK, it internally creates a unique id, similar to a generated PK, for the objects that it reads and these ids are discarded when no longer needed. The fact that the mapping is for tables without PK is known by the code that creates the tempo

RE: Cayenne Generated Classes in Web Service API

2007-06-07 Thread Kevin Menard
Hi Peter, > -Original Message- > From: Peter Schröder [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 07, 2007 11:45 AM > To: user@cayenne.apache.org > Subject: AW: Cayenne Generated Classes in Web Service API > > hi michael, > > we did some basic testing on sending cayenne classes vi

RE: Cayenne Generated Classes in Web Service API

2007-06-07 Thread Kevin Menard
Hi Michael, Last year we had a Google Summer of Code project that provided an ROP implementation via WSDL. I mentored the project, but still have not had the time to integrate it into Cayenne proper. If you're interested, we can look at what's necessary to complete that work. -- Kevin >

Re: Cayenne Generated Classes in Web Service API

2007-06-07 Thread Michael Lepine
Thanks for the reply. I'm no Web Service guru, but my understanding is that the object is transformed into an XML payload when sent from the client to the server. Once the server receives the XML post, it unmarshals the XML into object representations. That's why I figured I could get this to wor

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Dave Merrin
Hi John, as mentioned to Andrus I'm going with the setting primary keys on columns. I actually found some documentation for the database which said which columns make the rows unique. This keeps things relatively simple. BTW. also tried some prefetching todaycool stuff. I got some code d

AW: Cayenne Generated Classes in Web Service API

2007-06-07 Thread Peter Schröder
hi michael, we did some basic testing on sending cayenne classes via axis 1.4. that didnt really work out, because persistent objects provide references to unserializable objects. i think that this might be handled by a custom de-/serializer, but we did no further investigation. kind regars,

Re: Select Query on Table with no Primary Key

2007-06-07 Thread John
opps forgot a part from the SQL SELECT e.* , (SELECT COUNT(*) FROM MyView e2 WHERE e2.name <= e.name ) AS rownumber FROM MyView e ORDER BY name Order by must be added Sako. Signature IT-Consult Armainak Sarkis - Original Message - From: "John" <[EMAIL PROTECTED]> To: Sent: Thurs

Re: Select Query on Table with no Primary Key

2007-06-07 Thread John
Hello Dave, You said you use a view and you will NOT modify the data, then try this: Your View name : MyView. -- create another view call MyViewWithPK ---

Cayenne Generated Classes in Web Service API

2007-06-07 Thread Michael Lepine
This may be off topic but hopefully it's not considered to be. I am researching options for creating a web services-based API for our company's flagship product. The data model backing the application has quite a few tables. A lot of the functionality we want to support involves exporting or impo

Re: Select Query on Table with no Primary Key

2007-06-07 Thread John
Hello Andrus, I can get data from a table or a view, what about a StoredProcedure? can i get data from it? cos this could be the solution for Dave's problem Sako. - Original Message - From: "Andrus Adamchik" <[EMAIL PROTECTED]> To: Sent: Thursday, June 07, 2007 12:44 PM Subject:

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Dave Merrin
Hi Andrus, I was playing about with putting in my own EntityResolver. For now I'm going to take your approach and see how I get on. Cheers, Dave Andrus Adamchik wrote: To give an example - if you have an EMPLOYEE table, you can make an assumption that it is highly unlikely that there are tw

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Andrus Adamchik
To give an example - if you have an EMPLOYEE table, you can make an assumption that it is highly unlikely that there are two people with the same name, born on the same date, and working in the same department. On that assumption you can mark these 4 columns as PK in the Modeler: FIRST_NAME

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Andrus Adamchik
I'm kind of curious if Cayenne supports PK-less for read-only data now, though. Seems to me that could be a useful thing. It doesn't - otherwise you won't be able to build a valid ObjectId and hence - ensure uniqueness across the context. The only way we can potentially support it is by sup

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Andrus Adamchik
Tore is right - for Cayenne to handle an object (whether read-only on read/write), it needs to know which column or columns uniquely identify each row. Now... you can fake a PK in your model, even if there's none in the db - just select a really unique combination of columns, and mark those

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Dave Merrin
Hi Tore, I understand there will be limitations in the use of cayenne if there is no primary key; I can work with these. I'm using an Oracle database. The views were created to give restricted access to the data. The tables may have primary keys but I can't get these added to the views. We

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Tore Halset
On Jun 6, 2007, at 16:12 , Dave Merrin wrote: I'm trying to run a SelectQuery on a table with no primary key. Unfortunately it's not working. Can anybody help? I have no control over the database so I can't add in primary keys. As you know the PK are essential not only to update a row, but

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Dave Merrin
OK, I've stepped through the code and got to the ObjectResolver. In there it checks for primary keys and throws an exception if there aren't any. Is there any way I can override this code easily to removed the primary key check? ObjectResolver(DataContext context, ObjEntity entity, boolean

Re: Select Query on Table with no Primary Key

2007-06-07 Thread Dave Merrin
From a brief try this morning I don't think this works. I'm going to try again and also see if there is anything else I can do. Cheers, Dave Michael Gentry wrote: It's not a hijacking. It is interesting to point out that JPA does not support tables without PKs -- I really should learn more a