Thank you all. I understand now the reasons behind using VARCHAR.

I found my way around this. I can just change the data type in the
fieldtypepostnew.xml. This way I can declare all the ids as integers,
and indicators as boolean instead of CHAR(1).

However still wondering if there is a way to change the name of the ids
to only id without having to go through each foriegn key.



On Mon Apr 04,2011 05:08 am, David E Jones wrote:
> 
> As for naming all "id" fields just plain "id", it makes it far more difficult 
> to keep track of foreign keys. The nice thing about giving even sequenced ID 
> fields a somewhat unique name is that you can use that same name on other 
> entities/tables and have them match up automatically.
> 
> The Entity Engine does a lot with field name mapping for relationships 
> between entities, and there are thousands of these in the OFBiz data model, 
> so the few extra characters goes a long way toward making things easier to 
> understand and maintain.
> 
> -David
> 
> 
> On Apr 4, 2011, at 12:19 AM, Erwan de FERRIERES wrote:
> 
> > Le 03/04/2011 06:15, Mansour Al Akeel a ?crit :
> >> Hello all,
> >> 
> >> I am wondering about the reasons behind using VARCHAR for entities Id,
> >> instead of a numeric value with autoincrement. Another thing is the
> >> naming of the primary key. For example, accommodation_class has it's
> >> primary key as "accommodation_class_id". Wouldn't it be easier just to
> >> name it "id"?
> >> 
> >> 
> >> 
> >> 
> >> 
> > Hi Mansour,
> > 
> > just go to this page : 
> > http://ofbiz.135035.n4.nabble.com/Why-primary-keys-are-VAR-CHAR-type-in-OFBiz-td146555.html#a146562
> > 
> > Cheers,
> > 
> > -- 
> > Erwan de FERRIERES
> > www.nereide.biz
> 

Reply via email to