Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# monica 6/22/2006 1:58 AM
I am just a beginner of nhibernate technology, so I learn a lot in the aspect of nhibernate application from the cuyahoga framework. Thank you!

I wish you would give me a hand for the problem as below:

I change the field of roleuseid from int to varchar in cuyahoga_userrole table of database, accordingly I change the procedure.
when I insert a new user,there will be an exception: The field of roleuseid cann't be null.

I am puzzled:
I can understand if use the int data type with identity,there is no problem.
But how canI do to create the data in the field as primary key with varchar data type when using the "bag" in User.hbm.xml?
# mgaerber 6/22/2006 4:57 AM
Changing the core ddl will give you a hard time updating to following versions. What exactly would you like to achieve?

Maybe you can post your ddl and hbm.xml, so we might be able to help you.
# martijnb 6/23/2006 6:48 AM
I assume that monica is only learning NHibernate with Cuyahoga and not using it. Right?

If you change the primary key type to varchar, you'll need a different primary key generator mechanism. See http://www.hibernate.org/hib_docs/nhibernate/html/mapping.html#mapping-declaration-id for a detailed explanation of all possibilities.