views:

272

answers:

1

i read that in order to map a lass using Castle ActiveRecord the class must have a primary key (surrogate or composite)

now, suppose i have a table which i only want to use it for reading and the table doesn't have surrogate key and natural composite key neither

is there any way to be able to still have some manually Guid (or other id) generation to make it possible to map the class??

again, the table is used ONLY for reading purposes

A: 

There is a good description of Castle Active Record with Composite Key here:

http://www.castleproject.org/ActiveRecord/documentation/v1rc1/usersguide/pks.html

Note using composite key is not recommended.

How do you plan to select rows from your table if you have no key?

Shiraz Bhaiji
i said i have no primary key. in order to get data i want to usethe ActiveRecord/NHibernate query api
Krembo

related questions