You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by JS <jo...@gmail.com> on 2014/04/03 21:46:51 UTC

Data Loading and Entity Modification

Hello,

I have a question about the entity engine in OFBiz, mainly pertaining to how
changes to "entitymodel.xml" and seed data are handled when there is already
data in the entity.

I've done some searches and experimentation on my own to try and determine
this but came up inconclusive results:

1) If more seed data needs to be loaded after the system is already in
production, will the seed data loader skip loading records which are already
in the entity, and only add the new ones? If not, what is the recommended
way to add the new data to the entity if not using the seed data loading
functionality?

2) If a schema change is required (i.e. data type change, column
addition/removal) how do you go about doing this on a system already in
production (which will have existing data), using the entity engine? If it
can't be done with just the entity engine and would require an external DB
tool to do so, how do you ensure that OFBiz's "entitymodel" is back in sync
with the new DB schema?

Thanks!
J



--
View this message in context: http://ofbiz.135035.n4.nabble.com/Data-Loading-and-Entity-Modification-tp4650171.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: Data Loading and Entity Modification

Posted by Youssef Khaye <y....@unionsmarket.com>.
Le 03/04/2014 21:46, JS a écrit :
> Hello,
>
> I have a question about the entity engine in OFBiz, mainly pertaining to how
> changes to "entitymodel.xml" and seed data are handled when there is already
> data in the entity.
>
> I've done some searches and experimentation on my own to try and determine
> this but came up inconclusive results:
>
> 1) If more seed data needs to be loaded after the system is already in
> production, will the seed data loader skip loading records which are already
> in the entity, and only add the new ones? If not, what is the recommended
> way to add the new data to the entity if not using the seed data loading
> functionality?

when loading data (seed or demo ) from xml file, ofbiz proceed as 
folowing for each xml entry :
create a database record if it does not exists.
if the record exists and has at least one field with diffrenet value it 
make an update operation.
otherwise it does noting for the given xml entry.
for more detail, see create-replace that may change the entity loader 
behavior
>
> 2) If a schema change is required (i.e. data type change, column
> addition/removal) how do you go about doing this on a system already in
> production (which will have existing data), using the entity engine? If it
> can't be done with just the entity engine and would require an external DB
> tool to do so, how do you ensure that OFBiz's "entitymodel" is back in sync
> with the new DB schema?
ofbiz can only add missing tables, fields, contraints, indicies etc... 
to get database schema sync with its entitymodel.

operations like;
removing no more used tables, fileds..
change field type or name ...
should be done by the database administrator.
of course you should update your entity model and make sure it is sync 
with the database schema (look at ofbiz start log if the check-on-start 
is enabled in entity-engiine)

> Thanks!
> J
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Data-Loading-and-Entity-Modification-tp4650171.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.