Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Auto-incrementing Lazy loading caching cascading



I was reading folowing lines and I did not understand clearly.

Auto-incrementing keys
When you insert a row in the database, you typically assign it a primary key that
uniquely identifies that row. It is good practice to use a surrogate key for your primary
key. That is, the primary key should have no business meaning but is instead
generated within your application. Spring provides a means to do this via the
DataFieldMaxValueIncrementer interface. This interface has three different methods
for obtaining the next value to be used as a key: nextIntValue(), next-
LongValue(), and nextStringValue().
We would use a DataFieldMaxValueIncrementer like this:
We can then wire in an implementation of this interface. Spring comes with
implementations that hook into the sequence mechanism for Oracle, Postgre-
SQL, MySQL, and Hypersonic databases. You are free to write your own implementation
as well.










Lazy loading—As our object graphs become more complex, we sometimes
don’t want to fetch entire relationships immediately. To use a typical example,
suppose we are selecting a collection of PurchaseOrder objects, and
each of these objects contains a collection of LineItem objects. If we are
only interested in PurchaseOrder attributes, it makes no sense to grab the
LineItem data. This could be quite expensive. Lazy loading allows us to
grab data only as it is needed.

i was not clear on caching, cascading as well. Which one we have to use where and advantage and disadvanate of using them

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry
> i was not clear on caching, cascading as well. Which one we have to use where and advantage and disadvanate of using them

caching and cascading of what exactly? The text you posted is nothing to do with those concepts.
If you've posted the wrong question then simplest to just delete this one and reopen a new one
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial