OJB requires to have at least one attribute per class defined as primary key.
But it is sufficient to delare is as primary key in the field-descriptor. It is not required to be defined a primary key in the database.
So for a view you just have to define those attributes as primary that uniquely identify one row in the view.
cheers, Thomas
Manjula Venugopal (FS) wrote:
Hi Thomas,
Read your messages about accessing database views using OJB.
I have defined a view in Oracle database. And generated Java class using "reverse-db" tool.
When i use Persistence broker api class to query, the server throws error
org.apache.ojb.broker.metadata.ClassNotPersistenceCapableException: OJB needs at
least one primary key attribute for class objectClass=class entity.VBillContract, objectsRealClass=class entity.VBillContract
View has no primary key, so do you have any suggestion to over come this problem.
I have set "access=readonly" in field descriptors.
Thanks,
Manjula.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
