-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping unsigned long type (UInt64/ulong)
PostPosted: Tue May 01, 2007 10:17 am 
Newbie

Joined: Tue May 01, 2007 8:35 am
Posts: 4
How does we persist an unsigned long property on databases that doesn't support it?

At the time of writing, only the SQLite dialect supports DBType.UInt64 (if I'm right).

I've found many way to achieve this:

  • Map it with type="Serializable"
  • Create a custom value type that convert UInt64 <-> string
  • Define a private string property on the persistent class, wrap the public UInt64 property around it (Convert.ToString()/Convert.ToUInt64()) and declare only the private property on the mapping file
  • Define a private decimal property on the persistent class, wrap the public UInt64 property around it and declare only the private property on the mapping file with sql-type="NUMERIC(20, 0)"



Is there a "standard" way or even a better way than those listed before to map an UInt64 type on dialects that doesn't support it?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.