Entity Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Entity Question

Jorge Alanis
Hello,

I have been reading about ofbiz's entity layer and have some questions I hope someone can help me with.

I understand that in the file entitymodel.xml is the declaration of the tables in the database

example

<entity entity-name="Product"
            package-name="org.ofbiz.product.product"
            title="Product Entity">
      <field name="productId" type="id-ne"></field>
      <field name="productTypeId" type="id"></field>
      <field name="primaryProductCategoryId" type="id"></field>
      <field name="manufacturerPartyId" type="id"></field>
      <field name="facilityId" type="id"></field>
      <field name="introductionDate" type="date-time"></field>
      <field name="supportDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscWhenNotAvail" type="indicator"></field>
      <field name="internalName" type="description"></field>
      <field name="brandName" type="name"></field>
      <field name="comments" type="comment"></field>.......

How does ofbiz knows that instead of the fieldname productId, the column real name (in the db) is product_id?
How does data is retrieved from the database? I read that there are functions <entity and> or something like that.
I have another table with the product description, what do I need to do to make ofbiz read the description from that table?
In the case I have to merge both tables (so that the entity reads all info from the same table) how do I change the "field name" so that the application works...for example (ofbiz -> field name="comments", myapp ->field name="comentarios"), do I have to search for all the references of "comments" and replace them with "comentarios"?

I hope I was understandable. Thanks a lot.

Jorge Alanís
Reply | Threaded
Open this post in threaded view
|

Re: Entity Question

Jacques Le Roux
Administrator
Hi Jorge,

You may find this useful : http://ofbiz.apache.org/docs/entity.html

Jacques

----- Message d'origine -----
De : "Jorge S. Alanís Garza" <[hidden email]>
À : <[hidden email]>
Envoyé : jeudi 17 mai 2007 21:56
Objet : Entity Question


Hello,

I have been reading about ofbiz's entity layer and have some questions I
hope someone can help me with.

I understand that in the file entitymodel.xml is the declaration of the
tables in the database

example

<entity entity-name="Product"
            package-name="org.ofbiz.product.product"
            title="Product Entity">
      <field name="productId" type="id-ne"></field>
      <field name="productTypeId" type="id"></field>
      <field name="primaryProductCategoryId" type="id"></field>
      <field name="manufacturerPartyId" type="id"></field>
      <field name="facilityId" type="id"></field>
      <field name="introductionDate" type="date-time"></field>
      <field name="supportDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscontinuationDate" type="date-time"></field>
      <field name="salesDiscWhenNotAvail" type="indicator"></field>
      <field name="internalName" type="description"></field>
      <field name="brandName" type="name"></field>
      <field name="comments" type="comment"></field>.......

How does ofbiz knows that instead of the fieldname productId, the column
real name (in the db) is product_id?
How does data is retrieved from the database? I read that there are
functions <entity and> or something like that.
I have another table with the product description, what do I need to do
to make ofbiz read the description from that table?
In the case I have to merge both tables (so that the entity reads all
info from the same table) how do I change the "field name" so that the
application works...for example (ofbiz -> field name="comments",
myapp ->field name="comentarios"), do I have to search for all the
references of "comments" and replace them with "comentarios"?

I hope I was understandable. Thanks a lot.

Jorge Alanís