I have found a Java application using the SQL tables in which order is a sorted list of organizations sorted by columns.
Basically hibernate (and perhaps others) also provide this functionality. The problem is that objects are handled at once, which then becomes a big problem when the list becomes big Optional solution is a batch This will be done with SQL Update, for example like the following:
update table SET order_col = order_col + 1 WHERE command_ col & gt; Insert 47 table value ('new_id', 'new_description, ..., 47)
which is sharpened but not supported by the database engine.
Now, I think that such a batch's updating objects and their versioning, dirty check etc. are not so good at the time of thinking. I would still like to ask if somebody has some good ideas or if some firmness framework / ORM / you-name - this will provide some help. Of course I can do this with custom SQL / HQL / ... but wondering Whether there would be some solution beforehand (I thought that someone else could do something like this before and even under open source). Apart from this, other good ideas related to the problem are welcome =)
My advice is to do two things:
- Choose a large increment between your items, say one million. In this way you can change an item by 6,000,000 to 8,000,000 to 7,000,000; And
- Reorder items as batch jobs every now and again.
Large pay scales do not end the problem of large rearrangement, but it is necessary to do this there is no possibility of a major rearrangement and for each batch job they can be given a day / week / There is a need to reorder according to the requirement.
Changing items completely at one go is messy and asking for trouble.
Comments
Post a Comment