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


   HibernateはGNUのLGPLで公開、配布されているオープンソースのO/Rマッピングツールです。軽快な動作と実用性の高さでJDOの有力な対抗馬とされています。検索にはHQL(Hibernate Query Language)というSQLに似た独自の問い合わせ言語を使用する方法とオブジェクト指向な設定方法があります。サブクエリや集計関数もサポートするなど、JDOの問い合わせ言語であるJDOQLと比べるとかなり実用度が高いです。
  -2005/5/23 - Hibernate 3.0.4 リリース
  -- 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)
  -2005/5/8 - Hibernate 3.0.3 リリース
  --fixed bug in HQL for composite key classes which have a property named the same as the owning entity's id property
  --replaced 'connection.aggressive_release' with 'hibernate.connection.release_mode'
  --added ConnectionReleaseMode
  --added eager fetch for any associations with fetch=join, even after a HQL query, or cache retrieval (EJB3)
  --added replicate() isUpdate flag to OnReplicateVisitor, useful for native ids
  --fixed ParameterizedTypes order of initialization
  --fixed bug in DB2Dialect
  --fixed EntityMode.DOM4J creation of duplicate <set> output
  --fixed JDBCException error code handling
  --fixed Criteria Restrictions.isEmpty()/isNotEmpty() when collection is mapped to superclass
  --fixed HQL indexed collections access with no alias
  --fixed HQL aggregate functions on components when "id" property is used
  --fixed issue with non-cascading refresh to collections
  --fixed query-timeout not being applied to bulk HQL (Stephan Fudeus)
  --fixed pessimistic locking with Firebird (Yuichi Sugimura)
  --updated Ant 1.6.3
  --improved validation of sql queries, throw QueryException if addEntity() nor addScalar() was called
  --added automatic dialect detection if no dialect is configured
  --added new tutorial (Michael Gloegl, Christian Bauer)
  -2005/4/27 - Hibernate 3.0.2 リリース
  --fixed auto-close/auto-flush during getCurrentSession() processing
  --fixed ClassCastException with EntityMode.DOM4J
  --fixed HQL dynamic instantiation with iterate()
  --fixed HQL bug with missing parantheses and implicit joins
  --fixed bug were Interceptor.getEntity() wasn't called if in cache
  --fixed bug in merge() of sorted sets
  --fixed bug in EntityMode.DOM4J with non-lazy embedded many-to-ones
  --fixed Criteria/Projection ordering bug
  --fixed HQL referencing component attribute
  --fixed column duplication detection for components
  --fixed eager fetching for many-to-many associations
  --fixed stack overflow with auto_close_session and aggressive_release and unclosed ScrollableResults/HibernateIterator
  --fixed bug in HQL parser regarding naked property refs which reference component properties
  --fixed bug with eager fetched arrays not being loaded
  --fixed bug in filter against joined-subclass
  --improved CacheMode.GET/IGNORE, disabled cache put
  --improved HQL support for standard SQL functions, including coalesce() and nullif()
  --improved filtering of many-to-many associations
  --added HQL support for cast(x as type) if SQL database supports it
  --added increment id generation for union-subclass
  --added ConnectionProvider.supportsAggressiveRelease() for managed environments
  --added support for caching of queries if filter is enabled
  --added PreparedStatement count to Statistics
  --added transactional/nontransactional read()/get() to Cache API
  --added quotation of schema names
  --added Distinct to Projection API
  --added config parameter 'connection.aggressive_release'
  -2005/4/18 - Hibernate 3.0.1 リリース
  --added HQL tuple constructor/comparison feature
  --added HQL "fetch all properties" override if instrumentation is used for lazy loading
  --added HQL projection feature, return Lists instead of arrays for projection
  --added HQL projection feature, return Maps with user-defined HQL SELECT aliases as keys
  --added HQL support for expressions in aggregation functions
  --added new IntegrityViolationException to MySQL dialect
  --added value mapping type 'big_integer'
  --added not-found="ignore|exception" switch for legacy associations (i.e. broken database integrity)
  --added fully automatic Session scoping in JTA environments with sf.getCurrentSession()
  --fixed bug in DTD that wouldn't allow union-subclass in separate file
  --fixed a MS SQL Server case sensitivity issue with native SQL queries
  --fixed a minor bug in subselect fetching
  --fixed case sensitivity in HQL functions
  --fixed a bug with listener assignment for save() operation (Matthew Inger)
  --fixed return-property in named SQL queries to work with all identifier names
  --fixed TransactionManager lookup (again) for WAS 6.0
  --fixed a bug with HQL batch delete and MS SQL Server
  --fixed session not getting closed with auto_close when rollback occured
  --improved concatentation handling in AST parser
  --updated dom4j to avoid memory leak in old version
  --updated C3P0
  -2005/1/30 - Hibernate 2.1.8リリース
  --fixed a bad bug in saveOrUpdateCopy() that caused NonUniqueObjectExceptions
  --fixed problems with long types in Oracle DDL generation
  --fixed a memory management problem when deleting collections
  --schema export now uses hibernate.default_schema (Michael Gloegl)
  --fixed broken query cache invalidation from 2.1.7
  --fixed a problem with schema update on some databases
  --support MySQL rlike operator in HQL
  --fixed a minor problem with Hibernate Clobs and Blobs
  --added support for WebSphere's weird TxManagerLookup
  --Add LockAcquisitionErrorCodes to MySQL dialect (Jesse Barnum, Emmanuel Bernard)
  DB2,FrontBase,HSQLDB,informix,interbase,MS SQL server,MySQL, Oracle,Pointbase,PostgreSQL,Sybase etc.
  -接続するDB毎のHibernate設定ファイル(プロパティファイル or XMLファイル)
  -[[Working with Hibernate in Eclipse:]]
  -[[JFaceDbc:]] - RDBのフロントエンドですが、Hibernate用ソースコード(JAVA,XML)の出力機能があります。
  -[[Hibernator:]] - メタデータからテーブルを作成したり、HQLを発行して結果を確認したりできます。
  -[[Hibernate Synchronizer:]] - 定義ファイルウィザード、ファイルの同期など。
  -[[HiberClipse Plugin:]] - 定義ファイルの生成。
   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();
               // 追加の実行と生成されたIDの取得
               Long id = (Long);
               // 追加の確認(loadメソッド検索)
               Person load = (Person) session.load(Person.class, id);
               // 修正の実行
               // 修正の確認(HQLによるfindメソッド検索)
               List list = session.find("from Person where id=?", id, Hibernate.LONG);
               // 修正の確認(Expressionによるfindメソッド検索)
               List list2 =
                   session.createCriteria(Person.class).add(Expression.eq("id", id)).list();
               // 削除の実行
               // 削除の確認
               list = session.find("from Person");
               // SQLのコミット
           } 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"/>
  for update指定でselectした行をトランザクションの終了までロックする。~
  (for update nowaitを指定する場合は、LockMode.UPGRADEをLockMode.UPGRADE_NOWAITに変える)
   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 5.3.29

HTML convert time to 0.043 sec.