Compare the following three files:
framework/entity/fieldtype/fieldtypemysql.xml
framework/entity/fieldtype/fieldtypepostgres.xml
framework/entity/fieldtype/fieldtypepostnew.xml
I bet you are using mysql, or maybe even postgres, which has very LIMITED
key value lengths. In the real world, you never know what key length you
may need in the future, so why limit yourself? Now take a look at
"postnew", which uses a generic "text" type for almost all the fields. It
allows ANY key length, which allows the flexibility to create logical
relations, even for part numbers that may be 60 characters or so.
I learned this the hard way, when I came across long part numbers, and
struggled to figure out a way to logically store them. Back then I was
using mysql. I made the hard conversion to postgres, using
"postnew", defined in:
framework/entity/config/entityengine.xml:
<datasource name="localpostnew"
field-type-name="postnew"
And never had a problem since. You can then use UUID for anything.
On Tue, Apr 30, 2013 at 3:38 AM, Ofbiz 开发 <[email protected]> wrote:
> Hi everyone,
>
> I am considering using Java UUID for the ProductID (
> http://docs.oracle.com/javase/7/docs/api/java/util/UUID.html ), but that
> requires at least varchar (32), and the current ProductID field in database
> is only varchar(20), how hard is it to change to varchar(32) please? Is
> there any plan in Ofbiz trunk to change this to varchar(32) please? It
> seems better than using sequence.
>
> Thanks.
>
> Kind Regards
>
> Fong
>