Hi Michal, I agree, that the categories part is tricky. In the legacy system database you will most probably have the same category many times with different ID for each vendor. If you want to use the model with one category for all vendors than you will need to maintain mapping when you do the import process. This is some labor, I agree. However you should calculate the pros and cons. Should you perform this labor you will get some precious features. The end users will be able to search for a part in the "Brake-wheel hub" category which is compatible with BMW 330XD model year 2010 for example. End users wouldn't care about the vendor but the compatibility, because most of the car parts are often compatible with other brands and car models. The customers need a car part that works for them :) Do you know a software called TECDOC ? Have a look there, you'll get some ideas.
About EntityListIterator: it is a very very very recommended solution over the generic List. When you make a query which gets 1,000,000 results the database would create a cursor for you which contains the results. Using the EntityListIterator you would get the results one by one. You are not doing anything illegal as this is the model in JDBC as well - the java.sql.ResultSet class is also an interator. If you don't believe me you could perform a simple test - create 1,000,000 records into a table and fetch them in a List, do it 10 times without restarting the JVM and monitor the heap usage. You have a case where the memory usage depends on the number of the results - a classical example of memory leak :) Fetching the results in a List is convenient for small result sets - like nomenclature tables. All the rest should be done using EntityListIterator. Regards, Deyan On Sat, 2010-05-01 at 21:08 +0200, Michal Cukierman wrote: > Thank you Deyan for your post, > > Actualy those are very precious sugestions. Thank you very much for that. I > am now investigating possible ways for solving my concerns, Ofbiz is one of > tools that are pretented to be the best. There is one problem regarding > creation of complex categories structure. To be more precise: In my system I > am going to import all categories structures automaticly from suppliers. > Those can differ from each other. Your solution would be great if there will > be one model to refer. I tried to use structures from automotive software > like PartEpert or AllData. Unfortunately I am unable to gather data from > those databases. What is more: different part manufactures use different > numbering schema (yes, I am PLM consultant:)). Have you found a way of > modeling your structure, is there an open database keeping all those data? > I assume that most of companies do it manualy. In my case it could be > dificult, because of automatic import process. > > The best thing would be to have a categories structure based on Parts > numbers. We would be able to find replacements, variants and uses for each > part. As far I have not found a good solution for that. > > Regarding EntityListIterator, if its an implementation of Lazy loading > (fetch data 'just in time'), it could be a problem as well (1 000 000 calls > to a database is slow as well - but it will not kill my app). I see the > following solutions for solwing the problem: > > 1) join on rollup and Product category. > 2) select product categories where parent category id is not in ( select > from rollup ). > > I have not checked that as far as I don't have time for this at the moment. > Anyway, single query is the best solution. Databases are optimised for > operations like that and we should use it. > > > Regards, > MichaĆ > > 2010/5/1 Deyan Tsvetanov <[email protected]> > > > associations, for example: compatible with, replaceable by, > > required or anything else ( product_assoc_type table ) > >
