Hibernate のバックアップの現在との差分(No.9)



  --Major rework of Criteria queries, support for projection, grouping, aggregation, ordering by any attribute
  --various improvements to new HQL parser (Joshua Davis)
  --fixed a bug where <join fetch="select"> was broken for subclasses with duplicated property names
  --fixed problems with long types in Oracle DDL generation
  --added EnhancedUserType, UserCollectionType, UserVersionType
  --added CacheMode
  --fixed minor performance problem where cascade delete could add objects to second-level cache
  --added hibernate.default_batch_fetch_size
  --added hibernate.cache.use_structured_entries
  --different classes and collection roles may now share a cache region
  --don't include discriminators for abstract classes in generated SQL
  --it is no longer truly necessary for composite identifier classes to implement equals()/hashCode() (but still recommended)
  --workaround for bug in MySQL InnoDB with self-referential foreign keys
  --added lazy="true" to many-to-one and one-to-one mappings (requires bytecode instrumentation)

  --fixed a bad bug in saveOrUpdateCopy() that caused NonUniqueObjectExceptions
  --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.


  -[[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 =

               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.33

HTML convert time to 0.027 sec.