Hi, I found how foreing key names are defined in Castle ActiveRecord. I must specified ForeignKey property in BelongsTo explicitly.
Thanks you Thiago, you helped me a lot. Afshar Mohebbi On Nov 15, 4:01 am, Afshar Mohebbi <[email protected]> wrote: > Hi Thiago, > > I did not specify the foreign key names. So this may be the cause. But > how can do specify that in both NHibernate/Castle ActiveRecord? > > Thanks in Advance > > On Nov 14, 4:39 pm, Thiago Alves <[email protected]> wrote: > > > > > It happened to me once. My guess is that you did not specify the foreign key > > name, so NHibernate generates a random key name. When it does an update, it > > cannot determine whether the existing key represents the same relationship > > as the new key, so the relation is created again (please someone correct me > > if I'm wrong). > > > I've also heard that Update Schema is not as reliable as dropping the schema > > and create again. I never use Update because of that > > > Regards, > > Thiago Alves > > > On Sun, Nov 14, 2010 at 11:03 AM, Afshar Mohebbi > > <[email protected]>wrote: > > > > Hi, > > > > Suppose I have a database that is just created based on some hbms. I > > > add a field to one of entities and use SchemaUpdate to update databse > > > with current change. Unfortunately UpdateSchema in addition to > > > generating ascript to add the new field, gnerates mostly all foregin > > > key constraints again as duplicate. > > > > Am I missing something or is it a bug? > > > > Regards, > > > Afshar Mohebbi > > > > -- > > > You received this message because you are subscribed to the Google Groups > > > "nhusers" group. > > > To post to this group, send email to [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<nhusers%[email protected]> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/nhusers?hl=en.-Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
