Hibernate のバックアップ差分(No.19)



  -- Bug
  --- [HHH-516] - Interceptor.onFlushDirty() sometimes not called
  --- [HHH-517] - getDatabaseMajorVersion() not available in JDK 1.3
  --- [HHH-518] - SQL parser does not recognize all whitespace
  --- [HHH-519] - broken SQL when traversing many-to-many to joined <subselect>
  --- [HHH-529] - Bug in merge()
  -- New Feature
  --- added <natural-id> mapping
  --- [HHH-533] - allow unique-key on <property> and <many-to-one>
  --- [HHH-534] - efficient cache by natural key
  --- support for <comment> on MySQL
  -- Improvement
  --- [HHH-526] - log "Aggressively releasing JDBC Connection" as DEBUG instead of INFO
  --- various logging improvements

  -- Bug
  --- [HHH-452] - UnsavedValueFactory.instantiate does not wrap the Exception it catches
  --- [HHH-456] - Session still holds references to entities after close()
  --- [HHH-457] - Log info for structured second-level cache entries is incorrect
  --- [HHH-466] - Made default for MS SQL dialect definition more flexible
  --- [HHH-473] - Formula can't contain SQL cast keyword
  --- [HHH-484] - Order-by not applied to collections fetched by OuterJoinLoader
  --- [HHH-487] - Possible empty union in UnionSubclassEntityPersister
  --- [HHH-505] - Possible NullPointerException in BigIntegerType
  --- [HHH-507] - Cached List does not show additions
  --- Fixed bugs in subselect fetching
  -- New Feature
  --- [HHH-455] - Obtain non-intercepted Session by passing an EmptyInterceptor
  --- [HHH-467] - HQL: support for case when then else end IN select clause
  --- [HHH-485] - Support multiple collection join fetches (attention: Cartesian product) in native SQL queries
  --- Added SessionStatistics metric interface
  --- Added support for table and column level <comment> blocks
  --- Added Simplified Chinese translation of reference documentation (Xiaogang Cao)
  -- Improvement
  --- Any query may now join fetch >1 collection role (attention: Cartesian product)
  --- [HHH-454] - Add 2292 integrityViolationCode to Oracle9Dialect
  --- [HHH-503] - Implemented ViolatedConstraintNameExtracter for HSQLDialect (Frank Grimes)


  DB2,FrontBase,HSQLDB,informix,interbase,MS SQL server,MySQL, Oracle,Pointbase,PostgreSQL,Sybase etc.


  -[[Working with Hibernate in Eclipse:]]


   package test;
   import java.util.List;
   import java.util.Properties;
   import net.sf.hibernate.Hibernate;
   import net.sf.hibernate.HibernateException;
   import net.sf.hibernate.Session;
   import net.sf.hibernate.Transaction;
   import net.sf.hibernate.cfg.Configuration;
   import net.sf.hibernate.expression.Expression;
   public class SampleMain {
       public static void main(String[] args) {
           Configuration cfg = null;
           Session session = null;
           Transaction transaction = null;
           Properties props = new Properties();
           try {
               cfg = new Configuration().addClass(Person.class).addProperties(props);
               session = cfg.buildSessionFactory().openSession();
               transaction = session.beginTransaction();
               Person person = new Person();


               Long id = (Long);

               Person load = (Person) session.load(Person.class, id);


               List list = session.find("from Person where id=?", id, Hibernate.LONG);

               List list2 =
                   session.createCriteria(Person.class).add(Expression.eq("id", id)).list();


               list = session.find("from Person");

           } catch (Exception e) {
               try {
                   if (transaction != null)
               } catch (Exception e1) {
           } finally {
               try {
                   if (session != null && session.isOpen())
               } catch (HibernateException e1) {

   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
     <class name="test.Person" table="PERSON">
       <id name="id" column="ID" type="long">
         <generator class="native"/>
       <property name="name" column="NAME" type="string" length="20" not-null="true"/>

   Person load = (Person) session.load(Person.class, id, LockMode.UPGRADE);
   List list2 = session.createCriteria(Person.class)
                       .add(Expression.eq("id", id))
  #amazonkey2(JAVA DB)

トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS

Modified by MT22(Moriwaki Takashi)

"PukiWiki" 1.3.7 Copyright © 2001,2002,2003 PukiWiki Developers Team. License is GNU/GPL.
Based on "PukiWiki" 1.3 by sng
Powered by PHP 7.4.30

HTML convert time to 0.046 sec.