While I prefer GUIDs, HiLo combines the respection of UoW and readable
IDs. A second property would be unnecessary then. If it is required to
have consecutively numbered entities (AFAIK invoices need that in some
countries to fight tax evasion), I fall back to a trigger that inserts
the number into a separate property. That would however require you to
have additional schema definition scripts.

-Markus

2009/2/17 Stefan Steinegger <[email protected]>:
>
> I'm also interested in this. IDENTITY works for SqlServer, Oracle
> would need a sequence that is used in the insert statement. Is there
> any database independent solution? To make it a little more
> complicated, we are creating the database schema only from the mapping
> files (until now...).
>
> On 12 Feb., 09:26, Ken Egozi <[email protected]> wrote:
>> make OrderNumber readonly, and set IDENTITY on the field in the db (or use a
>> trigger, whadever)
>>
>>
>>
>> On Thu, Feb 12, 2009 at 10:22 AM, di97mni <[email protected]> wrote:
>>
>> > Wow! It seems that my mail was sent 6! times. Sorry about that! Don't
>> > know what happened.
>>
>> > On Feb 12, 8:11 am, Martin Nilsson <[email protected]> wrote:
>> > > I'm not sure how to setup my mapping to support both Guid and user
>> > friendly
>> > > id's. For example, my order has a Guid as a primary key but I want to
>> > give
>> > > the user a more friendly id, like 123456. How do you usually do that?
>>
>> > > public class Order
>> > > {
>> > >   public Guid Id {get; set;}
>> > >   public int OrderNumber {get; set;}
>>
>> > > }
>>
>> > > Note, I'm actually using Castle ActiveRecord but any tips here would,
>> > > hopefully, be convertable to AR.
>>
>> --
>> Ken 
>> Egozi.http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue.comhttp://www.castleproject.orghttp://www.gotfriends.co.il
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to