You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Bobby Lawrence <ro...@jlab.org> on 2005/01/13 21:13:44 UTC

no primary key

Is there a way to have a class with no primary key field descirptor?
All I want to do with OJB is retrieval.

-- Bobby





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: no primary key

Posted by Armin Waibel <ar...@apache.org>.
Hi,

isn't it possible to declare one field (or a combination of fields) as 
PK (in OJB metatadata, not in DB) to allow OJB the creation of unique 
Idenity objects?
OJB PK fields are independent from the DB PK's.

The creation of Identity objects of the persistent objects is needed to 
use caching and references (and other internal services).

regards,
Armin

Bobby Lawrence wrote:
> Yup - and it doesn't work.
> Exception---
> org.apache.ojb.broker.PersistenceBrokerException: 
> org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: OJB 
> needs at least one primary key attribute for class  
> objectsRealClass=class 
> org.jlab.mis.services.mics.generated.ComputingJob, 
> objectTopLevelClass=class org.jlab.mis.services.mics.generated.ComputingJob
> --Bobby
> 
> 
> Robert r. Sanders wrote:
> 
>> Have you tried it?  I am pretty sure it works; I think I've done it 
>> before, but if it doesn't work then I'd be interested to know.
>>
>> Bobby Lawrence wrote:
>>
>>> Is there a way to have a class with no primary key field descirptor?
>>> All I want to do with OJB is retrieval.
>>>
>>> -- Bobby
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: no primary key

Posted by Bobby Lawrence <ro...@jlab.org>.
Yup - and it doesn't work.
Exception---
org.apache.ojb.broker.PersistenceBrokerException: 
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: OJB 
needs at least one primary key attribute for class  
objectsRealClass=class 
org.jlab.mis.services.mics.generated.ComputingJob, 
objectTopLevelClass=class org.jlab.mis.services.mics.generated.ComputingJob
--Bobby


Robert r. Sanders wrote:

> Have you tried it?  I am pretty sure it works; I think I've done it 
> before, but if it doesn't work then I'd be interested to know.
>
> Bobby Lawrence wrote:
>
>> Is there a way to have a class with no primary key field descirptor?
>> All I want to do with OJB is retrieval.
>>
>> -- Bobby
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-user-help@db.apache.org
>>
>

-- 
----------------------------
Bobby Lawrence
MIS Application Developer

Jefferson Lab (www.jlab.org)

 Email: robertl@jlab.org
Office: (757) 269-5818
 Pager: (757) 584-5818
----------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org


Re: no primary key

Posted by "Robert r. Sanders" <ro...@ipov.net>.
Have you tried it?  I am pretty sure it works; I think I've done it 
before, but if it doesn't work then I'd be interested to know.

Bobby Lawrence wrote:

> Is there a way to have a class with no primary key field descirptor?
> All I want to do with OJB is retrieval.
>
> -- Bobby
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-user-help@db.apache.org
>

-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org