Reputation: 179
In my database table I don't have any primary or unique keys. I am using an Oracle database table.
1.Can I use Fluent nHibernate without primary or unique key?
2.If I can use it, how do I do the mapping? Because when Id
is not mapped it throws an exception.
Upvotes: 0
Views: 1610
Reputation: 293
If you are using oracle try to use "ROWID". But in my opinion If you don't have any primary or unique keys then better use your own ORM for your requirement.
Upvotes: 1
Reputation: 6684
Possible duplicate of Fluent-NHibernate table mapping with no primary key.
AFAIK all ORMs need a primary key. The main reason I see is to manage dirty tracking and caching mechanisms in session.
Also, there is no reason for you NOT to have a primary key in your table. Even if you think you don't need one, stick a auto incremented int column as the key and you should have no problems.
Upvotes: 2