摘要:Hibernate provides a dual-layer caching system with a first-level object cache(the Session) and a pluggable second-level data cache. The first-level cache isalways active—it’s used to reso...
阅读全文
摘要:In Hibernate, objects instantiated using the new operator aren’t immediately persistent.Their state is transient, which means they aren’t associated with any databasetable row, and so thei...
阅读全文
摘要:Along with Java identity (memory location) and object equality, we pickup database identity (location in the persistent data store). We now have three methodsfor identifying objects: ■ Object i...
阅读全文
摘要:Data Accessor Object(DAO) = Data + Accessor + Object
阅读全文
摘要:Mapping class inheritanceA simple strategy for mapping classes to database tables might be “one table for every class.” This approachsounds simple, and it works well until you encounter in...
阅读全文