you can find the answer in the doc! http://nhforge.org/doc/nh/en/index.html#mapping-declaration-id
On Wed, Apr 22, 2009 at 11:28 AM, Ahmed Emad <[email protected]> wrote: > thx for your reply i can understand u but only i ask if it is possible. > another concern unique and not-null properties can be assigned to <id> as < > property> > really i am grateful for your efforts > thx for your time and attention > 2009/4/22 Gustavo Ringel <[email protected]> > > May i ask if you are using a composite-id why are you generating? In >> general it is used to represent a natural key or two ids from other table in >> a many to many... >> >> I don't know the response, because i never use composite-ids but i think >> generation is not supported there. >> >> Gustavo. >> >> >> On Wed, Apr 22, 2009 at 11:10 AM, Ahmed Emad <[email protected]> wrote: >> >>> >>> thx for your reply >>> another thing >>> if i have a composite id to make one of <key-property> automtically >>> generated >>> i define generated=insert >>> or <generator class=" classname"> >>> >>> 2009/4/21 Gustavo Ringel <[email protected]> >>> >>>> It should work i do this in general with Database generated datetimes. >>>> >>>> Gustavo. >>>> >>>> >>>> On Tue, Apr 21, 2009 at 3:41 PM, Ahmed Emad <[email protected]> wrote: >>>> >>>>> Thank u for your reply >>>>> do u mean i can do that: >>>>> <property name="Number" column="Number" generated="insert"/> >>>>> >>>>> and in data base creation i make Number column Identity??? >>>>> >>>>> >>>>> 2009/4/21 Gustavo Ringel <[email protected]> >>>>> >>>>> You cannot use two ids, but you can set that a property is >>>>>> generated="insert" check the insert and update attributes also to see >>>>>> what >>>>>> you need there. >>>>>> >>>>>> Gustavo. >>>>>> >>>>>> >>>>>> On Tue, Apr 21, 2009 at 2:57 PM, Ahmed Emad <[email protected]>wrote: >>>>>> >>>>>>> >>>>>>> Can i add an identity property which isn't a primary key and another >>>>>>> one which is primary key? >>>>>>> >>>>>>> assume this case: >>>>>>> >>>>>>> table : User >>>>>>> UserId: ( PK,Identity). >>>>>>> Username:(Identity) >>>>>>> >>>>>>> can i map it like that: >>>>>>> >>>>>>> <id name="UserId" column="UserId" type="Int64"> >>>>>>> <generator class="native"/> >>>>>>> </id> >>>>>>> >>>>>>> <id name="Username" column="Username" type="Int64"> >>>>>>> <generator class="uuid.string"/> >>>>>>> </id> >>>>>>> >>>>>>> Will any error will occur ? >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
