0

I would like to have a simple lookup table in the database with a single numeric non-integer column. While the column is currently a primary key, nHibernate complains if I specify the type as non-integer (I need it to be a decimal). I can add a surrogate key column to this table, or is there a simple solution that I can implement with nHibernate to manage (read/insert/delete) the values in this table without needing a surrogate key column?

I guess I could use this code to select, but what about insert/delete? What's the best approach?

Community
  • 1
  • 1
Alex
  • 9,250
  • 11
  • 70
  • 81

1 Answers1

0

NHibernate only complains if the specified keygenerator doesn't support the type. I guess you haven' specified any generator which defaults to identity which can only handle integral types. with assigned you could provide the ids

Id(x => x.Id).GeneratedBy.Assigned();
Firo
  • 30,626
  • 4
  • 55
  • 94