`
sakakokiya
  • 浏览: 489947 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

 Hibernate 3 Core - Basic

阅读更多
General Design persistent classes
  • Write code for getters, setters and constructor
  • Identify correct implementation of equals() and hashcode()
  • Describe the Primary Key mapping mechanism and needed syntax
    • Explain mapping done using <id> element and @id annotation and corresponding relational structure
    • Describe the following generator strategies : increment, identity, native, sequence.
  • Name and explain the composite primary keys mapping strategies
    • Explain The <composite-id> element and corresponding annotation
    • Using an embedded composed primary key class
Write code that manipulates Configuration and SessionFactory objects
  • Construct a Configuration object that initializes itself reading hibernate.properties, hibernate.cfg.xml
  • Write a property-based and xml-based configuration file containing dialect and database connection information.
  • Describe the semantics of the following methods : openSession(), close(), addClass()
Create persistent object model classes containing types
  • Establish the difference between the lifecycle of an Entity and a Type
  • Write mapping file or annotation code that maps an Embedded Component in a POJO
  • Identify correct Value Type collection mapping using <set>, <list>, <bag> and <map>
  • Describe how to map a Component collection
  • Given a hibernate collection mapping (xml or annotations) validate a corresponding relational model
Entity Relationship Explain entities relationships and describe corresponding table structure
  • Describe Foreign Key mapping including
    • simple reference <many-to-one>
    • simple collection <one-to-many>, identify the following supported collection types <list>, <set>, <map>, <bag>
    • bidirectional association and the meaning of the inverse attribute
    • association table <many-to-many> mapping
    • enhanced association Table, write code that use a composite-element to map an association table containing data
    • Describe how to make hibernate constrain Foreign Key in one-to-one relationships
  • Predict hibernate behaviour concerning cascading
    • Identify the correct cascade attribute values and link them to the POJO lifecycle.
    • Given code, establish what changes will be propagated to the database
  • Troubleshoot performance problems using fetching and lazy loading principles (lazy & fetch attributes values)
Inheritance For the following inheritance mapping strategies
  • Table per subclass <joined-subclass/>
  • Table per class hierarchy <discriminator/> <subclass/>
  • Table per subclass with discriminator <discriminator/> <subclass/> <join/>
  • Table per concrete class
  • Table per concrete class with UNION <union-subclass>
Be able to
  • Explain pros and cons, basic knowledge of the different strategies and their differences
  • Identify corresponding database structure
  • Write code that establish a polymorphic association
Lifecycle Be comfortable with hibernate lifecycle
  • Identify entity States : persistent, transient, detached
  • Describe State Transition API : clear(), close(), save(), saveOrUpdate(), persist(), evict(), merge(), contains(), delete() and update()
    • Given code, identify when flushing is done.
  • Explain the Dirty Checking mechanism
    • describe and understand the basic principle
    • establish how hibernate handles basic type and collection dirty checking
  • Explain the purpose of the StatelessSession class
Object retrieval and Query Given the following entity Fetching techniques
  • Hibernate Query Language
    • Write queries with basic syntax (from, select, where), sorting, aggregate functions
    • Describe the Java object structure returned by queries such as
      • select user from User as user
      • select user, user.name from User as user
    • Write code using the Session API that creates and execute queries
    • Inject parameters values in where clauses : using Query.setXXX() methods
    • Externalize queries in mapping files
  • Query by Criterias and Query by Example
    • Write code that executes a simple query (equivalent to select + where + sorting)
    • Describe the purpose of the following related APIs : createCriteria(), Restrictions, Projections, Order, Criterion, Example, Example.create()
  • Native SQL query
    • Identify the 2 places where you define the SQL query string (hardcoded or externalized)
    • Describe how to retrieve an externalized query using the Session API
Transaction Basic knowledge of Transaction and related things
  • Write java code that use the Transaction object
    • Start and End a transaction
    • Test whether a transaction is active
    • Rollback a transaction
    • Write proper try-catch structure
    • Identify Hibernate's implementations of the org.hibernate.Transaction interface
  • Pessimistic Locking
    • Write code that pessimistic-locks an entity using the related APIs Session.get()
    • Identify the different LockModes
  • Optimistic Locking
    • Declare optimistic locking in mapping files <version> and <timestamp> and Annotations.
    • Explain when a StaleObjectStateException can be thrown
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics