Author: dgolovin
Date: 2011-11-18 19:53:14 -0500 (Fri, 18 Nov 2011)
New Revision: 36463
Added:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/dom4j-1.6.1.jar
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/hibernate-core-4.0.0.CR6.jar
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/HibernateUtil.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/PeopleManager.java
Removed:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/hibernate3.jar
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/.classpath
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/hibernate.cfg.xml
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.hbm.xml
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/cut/MonetoryAmountUserType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/hql/ClassificationType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/instrument/domain/CustomBlobType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/CustomPersister.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/DoubleStringType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/MultiplicityType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/rowid/RowIdType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/typeparameters/DefaultValueIntegerType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/MyListType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/PersistentMyList.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/DefaultableListType.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/PersistentDefaultableList.java
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/where/NumericTrueFalseType.java
Log:
sampleproject.project mappingtypes migrated to hibernate4
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/.classpath
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/.classpath 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/.classpath 2011-11-19
00:53:14 UTC (rev 36463)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="lib" path="lib/hibernate3.jar"/>
+ <classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="lib"
path="lib/hibernate-core-4.0.0.CR6.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/dom4j-1.6.1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/hibernate-core-4.0.0.CR6.jar
===================================================================
(Binary files differ)
Property changes on:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/hibernate-core-4.0.0.CR6.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/lib/hibernate3.jar
===================================================================
(Binary files differ)
Added:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/HibernateUtil.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/HibernateUtil.java
(rev 0)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/HibernateUtil.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -0,0 +1,28 @@
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.service.ServiceRegistryBuilder;
+
+public class HibernateUtil {
+
+ private static final SessionFactory sessionFactory = buildSessionFactory();
+
+ private static SessionFactory buildSessionFactory() {
+ try {
+ // Create the SessionFactory from hibernate.cfg.xml
+ return new Configuration().configure().buildSessionFactory(new
ServiceRegistryBuilder()
+ .configure().buildServiceRegistry());
+// return new MetadataSources(new ServiceRegistryBuilder()
+//
.configure().buildServiceRegistry()).buildMetadata().buildSessionFactory();
+
+ }
+ catch (Throwable ex) {
+ // Make sure you log the exception, as it might be swallowed
+ System.err.println("Initial SessionFactory creation failed." +
ex);
+ throw new ExceptionInInitializerError(ex);
+ }
+ }
+
+ public static SessionFactory getSessionFactory() {
+ return sessionFactory;
+ }
+}
\ No newline at end of file
Property changes on:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/HibernateUtil.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/PeopleManager.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/PeopleManager.java
(rev 0)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/PeopleManager.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -0,0 +1,28 @@
+import mapping.compositeelement.*;
+
+import org.hibernate.Session;
+
+import java.util.*;
+
+ public class PeopleManager {
+
+ public static void main(String[] args) {
+ PeopleManager mgr = new PeopleManager();
+ mgr.createAndStoreParent();
+ HibernateUtil.getSessionFactory().close();
+ }
+
+ private void createAndStoreParent() {
+ HibernateUtil.getSessionFactory().openSession();
+ Session session = HibernateUtil.getSessionFactory().getCurrentSession();
+ session.beginTransaction();
+
+ Parent theParent = new Parent("Parent2");
+ theParent.getChildren().add(new Child("Child1"));
+ theParent.getChildren().add(new Child("Child2"));
+ session.save(theParent);
+ session.getTransaction().commit();
+ }
+
+
+ }
\ No newline at end of file
Property changes on:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/PeopleManager.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/hibernate.cfg.xml
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/hibernate.cfg.xml 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/hibernate.cfg.xml 2011-11-19
00:53:14 UTC (rev 36463)
@@ -1,473 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
-<hibernate-configuration>
- <session-factory>
- <property
name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
+<p:hibernate-configuration
xmlns:p="http://www.hibernate.org/xsd/hibernate-configuration"
xmlns="http://www.w3.org/2001/XMLSchema-instance"
schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration
/home/eskimo/Java/hibernate-release-4.0.0.CR5/project/hibernate-core/src/main/resources/org/hibernate/hibernate-configuration-4.0.xsd"
>
+ <p:session-factory>
+ <!-- Database connection settings -->
+ <p:property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</p:property>
+ <p:property
name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost:1701</p:property>
+ <p:property
name="hibernate.connection.username">sa</p:property>
+ <p:property
name="hibernate.connection.password"></p:property>
-<!--
- <mapping
resource="mapping/declaration/id/MappedClassWithId.hbm.xml"/>
- <mapping
resource="mapping/declaration/id/MappedClassWithoutId.hbm.xml"/>
- <mapping
resource="mapping/declaration/id/composite/v1/KeyManyToOneClass.hbm.xml"/>
- <mapping
resource="mapping/declaration/id/composite/v1/mapping.hbm.xml"/>
- <mapping
resource="mapping/declaration/id/composite/v2/mapping.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/list/CollectionList.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/list/CollectionListItem.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/map/CollectionListMap.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/map/CollectionMap.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/map/CollectionMapMany.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/set/CollectionSet.hbm.xml"/>
- <mapping
resource="mapping/value/type/collection/set/CollectionSetItem.hbm.xml"/>
+ <!-- JDBC connection pool (use the built-in) -->
+ <p:property
name="hibernate.connection.pool_size">1</p:property>
- <mapping
resource="mapping/abstractembeddedcomponents/cid/abstractembeddedcomponents.cid.hbm.xml"/>
- <mapping
resource="mapping/abstractembeddedcomponents/propertyref/Mappings.hbm.xml"/>
+ <!-- SQL dialect -->
+ <p:property
name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</p:property>
- <mapping resource="mapping/any/Person.hbm.xml"/>
- <mapping resource="mapping/any/Properties.hbm.xml"/>
+ <!-- Enable Hibernate's automatic session context management -->
+ <p:property
name="hibernate.current_session_context_class">thread</p:property>
- <mapping resource="mapping/array/A.hbm.xml"/>
+ <!-- Disable the second-level cache -->
+ <p:property
name="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</p:property>
- <mapping resource="mapping/batch/DataPoint.hbm.xml"/>
+ <!-- Echo all executed SQL to stdout -->
+ <p:property name="hibernate.show_sql">true</p:property>
- <mapping resource="mapping/batchfetch/ProductLine.hbm.xml"/>
+ <!-- Drop and re-create the database schema on startup -->
+ <p:property
name="hibernate.hbm2ddl.auto">update</p:property>
- <mapping resource="mapping/bidi/Auction.hbm.xml"/>
- <mapping resource="mapping/bidi/Auction2.hbm.xml"/>
-
- <mapping resource="mapping/bytecode/Bean.hbm.xml"/>
-
- <mapping resource="mapping/cache/Item.hbm.xml"/>
-
- <mapping resource="mapping/cascade/Job.hbm.xml"/>
- <mapping resource="mapping/cascade/JobBatch.hbm.xml"/>
-
- <mapping resource="mapping/cid/Customer.hbm.xml"/>
- <mapping resource="mapping/cid/LineItem.hbm.xml"/>
- <mapping resource="mapping/cid/Order.hbm.xml"/>
- <mapping resource="mapping/cid/Product.hbm.xml"/>
-
- <mapping resource="mapping/collection/bag/Mappings.hbm.xml"/>
- <mapping resource="mapping/collection/idbag/Mappings.hbm.xml"/>
- <mapping resource="mapping/collection/list/Mappings.hbm.xml"/>
- <mapping resource="mapping/collection/map/Mappings.hbm.xml"/>
- <mapping
resource="mapping/collection/original/UserPermissions.hbm.xml"/>
- <mapping resource="mapping/collection/set/Mappings.hbm.xml"/>
-
- <mapping resource="mapping/component/basic/User.hbm.xml"/>
- <mapping
resource="mapping/component/cascading/collection/Mappings.hbm.xml"/>
- <mapping
resource="mapping/component/cascading/toone/Mappings.hbm.xml"/>
-
- <mapping resource="mapping/compositeelement/Parent.hbm.xml"/>
-
- <mapping resource="mapping/connections/Silly.hbm.xml"/>
-
- <mapping resource="mapping/criteria/Enrolment.hbm.xml"/>
-
- <mapping resource="mapping/cuk/Person.hbm.xml"/>
- <mapping resource="mapping/cut/Transaction.hbm.xml"/>
- <mapping resource="mapping/cut/types.hbm.xml"/>
-
- <mapping resource="mapping/deletetransient/Person.hbm.xml"/>
-
- <mapping
resource="mapping/dialect/functional/cache/TestInterSystemsFunctionsClass.hbm.xml"/>
-
- <mapping resource="mapping/discriminator/Person.hbm.xml"/>
-
--->
- <mapping
resource="mapping/dynamicentity/interceptor/Customer.hbm.xml"/>
-<!--
- <mapping
resource="mapping/dynamicentity/tuplizer/Customer.hbm.xml"/>
-
- <mapping resource="mapping/ecid/Course.hbm.xml"/>
-
- <mapping resource="mapping/entitymode/dom4j/many2one/Car.hbm.xml"/>
-
- <mapping resource="mapping/entitymode/multi/Stock.hbm.xml"/>
- <mapping resource="mapping/entitymode/multi/Valuation.hbm.xml"/>
-
- <mapping resource="mapping/entitymode/dom4j/basic/AB.hbm.xml"/>
- <mapping resource="mapping/entitymode/dom4j/basic/Account.hbm.xml"/>
- <mapping
resource="mapping/entitymode/dom4j/basic/Employer.hbm.xml"/>
-
- <mapping resource="mapping/exception/Group.hbm.xml"/>
- <mapping resource="mapping/exception/User.hbm.xml"/>
-
- <mapping resource="mapping/extendshbm/allinone.hbm.xml"/>
- <mapping resource="mapping/extendshbm/allseparateinone.hbm.xml"/>
- <mapping resource="mapping/extendshbm/Customer.hbm.xml"/>
- <mapping resource="mapping/extendshbm/Employee.hbm.xml"/>
- <mapping resource="mapping/extendshbm/entitynames.hbm.xml"/>
- <mapping resource="mapping/extendshbm/packageentitynames.hbm.xml"/>
- <mapping resource="mapping/extendshbm/Person.hbm.xml"/>
- <mapping resource="mapping/extendshbm/unionsubclass.hbm.xml"/>
-
- <mapping resource="mapping/extralazy/UserGroup.hbm.xml"/>
-
- <mapping resource="mapping/filter/Category.hbm.xml"/>
- <mapping resource="mapping/filter/defs.hbm.xml"/>
- <mapping resource="mapping/filter/Department.hbm.xml"/>
- <mapping resource="mapping/filter/LineItem.hbm.xml"/>
- <mapping resource="mapping/filter/Order.hbm.xml"/>
- <mapping resource="mapping/filter/Product.hbm.xml"/>
- <mapping resource="mapping/filter/Salesperson.hbm.xml"/>
-
- <mapping resource="mapping/formulajoin/Master.hbm.xml"/>
-
- <mapping resource="mapping/generated/ComponentOwner.hbm.xml"/>
- <mapping
resource="mapping/generated/GeneratedPropertyEntity.hbm.xml"/>
- <mapping
resource="mapping/generated/MSSQLGeneratedPropertyEntity.hbm.xml"/>
-
- <mapping
resource="mapping/generatedkeys/identity/MyEntity.hbm.xml"/>
-
- <mapping resource="mapping/generatedkeys/select/MyEntity.hbm.xml"/>
-
- <mapping
resource="mapping/generatedkeys/seqidentity/MyEntity.hbm.xml"/>
-
- <mapping resource="mapping/hql/Animal.hbm.xml"/>
- <mapping resource="mapping/hql/BooleanLiteralEntity.hbm.xml"/>
- <mapping resource="mapping/hql/ComponentContainer.hbm.xml"/>
- <mapping resource="mapping/hql/CrazyIdFieldNames.hbm.xml"/>
- <mapping resource="mapping/hql/WithCrazyCompositeKey.hbm.xml"/>
- <mapping resource="mapping/hql/FooBarCopy.hbm.xml"/>
- <mapping resource="mapping/hql/KeyManyToOneEntity.hbm.xml"/>
- <mapping
resource="mapping/hql/SimpleEntityWithAssociation.hbm.xml"/>
- <mapping
resource="mapping/hql/SimpleEntityWithAssociation.hbm.xml"/>
- <mapping resource="mapping/hql/Vehicle.hbm.xml"/>
- <mapping resource="mapping/hql/Versions.hbm.xml"/>
-
- <mapping resource="mapping/id/Car.hbm.xml"/>
- <mapping resource="mapping/id/Plane.hbm.xml"/>
- <mapping resource="mapping/id/Product.hbm.xml"/>
- <mapping resource="mapping/id/Radio.hbm.xml"/>
-
- <mapping resource="mapping/idbag/UserGroup.hbm.xml"/>
-
- <mapping resource="mapping/idclass\Customer.hbm.xml"/>
-
- <mapping
resource="mapping\idgen\enhanced\forcedtable\Basic.hbm.xml"/>
- <mapping
resource="mapping\idgen\enhanced\forcedtable\HiLo.hbm.xml"/>
- <mapping
resource="mapping\idgen\enhanced\forcedtable\Pooled.hbm.xml"/>
-
- <mapping resource="mapping\idgen\enhanced\sequence\Basic.hbm.xml"/>
- <mapping resource="mapping\idgen\enhanced\sequence\HiLo.hbm.xml"/>
- <mapping resource="mapping\idgen\enhanced\sequence\Pooled.hbm.xml"/>
-
- <mapping resource="mapping\idgen\enhanced\table\Basic.hbm.xml"/>
- <mapping resource="mapping\idgen\enhanced\table\HiLo.hbm.xml"/>
- <mapping resource="mapping\idgen\enhanced\table\Pooled.hbm.xml"/>
-
- <mapping resource="mapping\idprops\Mapping.hbm.xml"/>
-
- <mapping resource="mapping\immutable\ContractVariation.hbm.xml"/>
-
- <mapping resource="mapping\insertordering\Mapping.hbm.xml"/>
-
- <mapping resource="mapping\instrument\domain\Documents.hbm.xml"/>
- <mapping resource="mapping\instrument\domain\Problematic.hbm.xml"/>
-
- <mapping resource="mapping\interceptor\Image.hbm.xml"/>
- <mapping resource="mapping\interceptor\User.hbm.xml"/>
-
- <mapping resource="mapping\interfaceproxy\Item.hbm.xml"/>
-
- <mapping resource="mapping\iterate\Item.hbm.xml"/>
-
- <mapping resource="mapping\join\Person.hbm.xml"/>
-
- <mapping resource="mapping\joinedsubclass\Person.hbm.xml"/>
-
- <mapping resource="mapping\joinfetch\ItemBid.hbm.xml"/>
- <mapping resource="mapping\joinfetch\UserGroup.hbm.xml"/>
-
- <mapping resource="mapping\jpa\Item.hbm.xml"/>
- <mapping resource="mapping\jpa\MyEntity.hbm.xml"/>
- <mapping resource="mapping\jpa\Part.hbm.xml"/>
-
- <mapping resource="mapping\jpa\cascade\ParentChild.hbm.xml"/>
-
- <mapping resource="mapping\jpa\fetch\Person.hbm.xml"/>
-
- <mapping
resource="mapping\keymanytoone\bidir\component\EagerMapping.hbm.xml"/>
- <mapping
resource="mapping\keymanytoone\bidir\component\LazyMapping.hbm.xml"/>
-
- <mapping
resource="mapping\keymanytoone\bidir\embedded\Mapping.hbm.xml"/>
-
- <mapping resource="mapping\lazycache\Documents.hbm.xml"/>
-
- <mapping resource="mapping\lazyonetoone\Person.hbm.xml"/>
-
-
-
-
-
-
- <mapping resource="mapping\legacy\ABC.hbm.xml"/>
- <mapping resource="mapping\legacy\ABCExtends.hbm.xml"/>
-
- <mapping resource="mapping\legacy\ABCProxy.hbm.xml"/>
-
- <mapping resource="mapping\legacy\AltSimple.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Baz.hbm.xml"/>
- <mapping resource="mapping\legacy\FooBar.hbm.xml"/>
- <mapping resource="mapping\legacy\Glarch.hbm.xml"/>
- <mapping resource="mapping\legacy\Fee.hbm.xml"/>
java.lang.NullPointerException at
org.hibernate.mapping.ManyToOne.createPropertyRefConstraints(ManyToOne.java:47)
- <mapping resource="mapping\legacy\Fum.hbm.xml"/>
- <mapping resource="mapping\legacy\Qux.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Blobber.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Broken.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Category.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Circular.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Commento.hbm.xml"/>
- <mapping resource="mapping\legacy\Marelo.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Componentizable.hbm.xml"/>
-
- <mapping resource="mapping\legacy\ComponentNotNullMaster.hbm.xml"/>
org.hibernate.MappingException: component class not found:
mapping.legacy.ComponentNotNullMaster$ContainerInnerClass
- <mapping resource="mapping\legacy\Many.hbm.xml"/>
- <mapping resource="mapping\legacy\Simple.hbm.xml"/>
- <mapping resource="mapping\legacy\One.hbm.xml"/>
-
- <mapping resource="mapping\legacy\CompositeIdId.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Container.hbm.xml"/>
org.hibernate.MappingException: java.lang.ClassNotFoundException:
mapping.legacy.GlarchProxy
- <mapping resource="mapping\legacy\Simple.hbm.xml"/>
- <mapping resource="mapping\legacy\Holder.hbm.xml"/>
- <mapping resource="mapping\legacy\Many.hbm.xml"/>
- <mapping resource="mapping\legacy\One.hbm.xml"/>
- <mapping resource="mapping\legacy\FooBar.hbm.xml"/>
- <mapping resource="mapping\legacy\Glarch.hbm.xml"/>
- <mapping resource="mapping\legacy\Baz.hbm.xml"/>
- <mapping resource="mapping\legacy\Fee.hbm.xml"/>
- <mapping resource="mapping\legacy\Qux.hbm.xml"/>
- <mapping resource="mapping\legacy\Fum.hbm.xml"/>
- <mapping resource="mapping\legacy\Simple.hbm.xml"/>
- <mapping resource="mapping\legacy\Many.hbm.xml"/>
- <mapping resource="mapping\legacy\One.hbm.xml"/>
- <mapping resource="mapping\legacy\Glarch.hbm.xml"/>
- <mapping resource="mapping\legacy\Fee.hbm.xml"/>
- <mapping resource="mapping\legacy\Qux.hbm.xml"/>
- <mapping resource="mapping\legacy\Fum.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Custom.hbm.xml"/>
-
- <mapping resource="mapping\legacy\CustomSQL.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Eye.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Fo.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Fumm.hbm.xml"/>
- <mapping resource="mapping\legacy\Fum.hbm.xml"/>
- <mapping resource="mapping\legacy\Qux.hbm.xml"/>
-
- <mapping resource="mapping\legacy\IJ.hbm.xml"/>
-
- <mapping resource="mapping\legacy\IJ2.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Immutable.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Location.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Map.hbm.xml"/>
-
- <mapping resource="mapping\legacy\MasterDetail.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Middle.hbm.xml"/>
-
- <mapping resource="mapping\legacy\MultiExtends.hbm.xml"/>
- <mapping resource="mapping\legacy\Multi.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Nameable.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Object2.hbm.xml"/>
- <mapping resource="mapping\legacy\MainObject.hbm.xml"/>
-
- <mapping resource="mapping\legacy\ParentChild.hbm.xml"/>
-
- <mapping resource="mapping\legacy\SingleSeveral.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Stuff.hbm.xml"/>
- <mapping resource="mapping\legacy\FooBar.hbm.xml"/>
- <mapping resource="mapping\legacy\Glarch.hbm.xml"/>
- <mapping resource="mapping\legacy\Baz.hbm.xml"/>
- <mapping resource="mapping\legacy\Fee.hbm.xml"/>
- <mapping resource="mapping\legacy\Qux.hbm.xml"/>
- <mapping resource="mapping\legacy\Fum.hbm.xml"/>
-
- <mapping resource="mapping\legacy\UpDown.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Vetoer.hbm.xml"/>
-
- <mapping resource="mapping\legacy\Wicked.hbm.xml"/>
-
- <mapping resource="mapping\legacy\WZ.hbm.xml"/>
-
- <mapping resource="mapping\legacy\XY.hbm.xml"/>
-
-
-
-
- <mapping resource="mapping\lob\LobMappings.hbm.xml"/>
-
- <mapping resource="mapping\manytomany\UserGroup.hbm.xml"/>
-
- <mapping resource="mapping\manytomany\ordered\UserGroup.hbm.xml"/>
-
- <mapping resource="mapping\map\UserGroup.hbm.xml"/>
-
- <mapping resource="mapping\mapcompelem\ProductPart.hbm.xml"/>
-
- <mapping resource="mapping\mapelemformula\UserGroup.hbm.xml"/>
-
- <mapping
resource="mapping\mappingexception\InvalidMapping.hbm.xml"/>
- <mapping resource="mapping\mappingexception\User.hbm.xml"/>
-
- <mapping resource="mapping\mixed\Item.hbm.xml"/>
-
- <mapping resource="mapping\naturalid\User.hbm.xml"/>
-
- <mapping resource="mapping\ondelete\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetomany\Parent.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\formula\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\joined\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\link\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\nopojo\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\optional\Person.hbm.xml"/>
-
- <mapping resource="mapping\onetoone\singletable\Person.hbm.xml"/>
-
- <mapping resource="mapping\ops\Competition.hbm.xml"/>
- <mapping resource="mapping\ops\Employer.hbm.xml"/>
- <mapping resource="mapping\ops\Node.hbm.xml"/>
- <mapping resource="mapping\ops\OneToOne.hbm.xml"/>
- <mapping resource="mapping\ops\OptLockEntity.hbm.xml"/>
-
- <mapping resource="mapping\optlock\Document.hbm.xml"/>
-
- <mapping resource="mapping\ordered\Search.hbm.xml"/>
-
- <mapping resource="mapping\orphan\Mail.hbm.xml"/>
- <mapping resource="mapping\orphan\Product.hbm.xml"/>
- <mapping resource="mapping\orphan\User.hbm.xml"/>
-
- <mapping resource="mapping\pagination\DataPoint.hbm.xml"/>
-
- <mapping resource="mapping\propertyref\basic\Person.hbm.xml"/>
-
- <mapping
resource="mapping\propertyref\component\complete\Mapping.hbm.xml"/>
-
- <mapping
resource="mapping\propertyref\component\partial\Mapping.hbm.xml"/>
-
- <mapping
resource="mapping\propertyref\inheritence\discrim\Person.hbm.xml"/>
-
- <mapping
resource="mapping\propertyref\inheritence\joined\Person.hbm.xml"/>
-
- <mapping
resource="mapping\propertyref\inheritence\union\Person.hbm.xml"/>
-
- <mapping resource="mapping\proxy\DataPoint.hbm.xml"/>
-
- <mapping resource="mapping\querycache\Item.hbm.xml"/>
-
- <mapping resource="mapping\readonly\DataPoint.hbm.xml"/>
-
- <mapping resource="mapping\reattachment\Mappings.hbm.xml"/>
-
- <mapping resource="mapping\rowid\Point.hbm.xml"/>
-
- <mapping resource="mapping\schemaupdate\1_Version.hbm.xml"/>
- <mapping resource="mapping\schemaupdate\2_Version.hbm.xml"/>
-
- <mapping resource="mapping\sorted\Search.hbm.xml"/>
-
- <mapping resource="mapping\sql\check\oracle-mappings.hbm.xml"/>
-
- <mapping
resource="mapping\sql\hand\custom\datadirect\oracle\StoredProcedures.hbm.xml"/>
-
- <mapping resource="mapping\stateless\Document.hbm.xml"/>
-
- <mapping resource="mapping\stats\Continent.hbm.xml"/>
- <mapping resource="mapping\stats\Continent2.hbm.xml"/>
-
- <mapping
resource="mapping\subclassfilter\discrim-subclass.hbm.xml"/>
- <mapping resource="mapping\subclassfilter\joined-subclass.hbm.xml"/>
- <mapping resource="mapping\subclassfilter\union-subclass.hbm.xml"/>
-
- <mapping resource="mapping\subselect\Beings.hbm.xml"/>
-
- <mapping resource="mapping\subselectfetch\ParentChild.hbm.xml"/>
-
- <mapping resource="mapping\ternary\Ternary.hbm.xml"/>
-
- <mapping resource="mapping\ternary\Ternary.hbm.xml"/>
-
- <mapping resource="mapping\timestamp\User.hbm.xml"/>
-
- <mapping resource="mapping\tm\Item.hbm.xml"/>
-
- <mapping resource="mapping\tool\Team.hbm.xml"/>
-
- <mapping resource="mapping\typedmanytoone\Customer.hbm.xml"/>
-
- <mapping resource="mapping\typedonetoone\Customer.hbm.xml"/>
-
- <mapping resource="mapping\typeparameters\Typedef.hbm.xml"/>
- <mapping resource="mapping\typeparameters\Widget.hbm.xml"/>
-
- <mapping resource="mapping\unconstrained\Person.hbm.xml"/>
-
- <mapping resource="mapping\unidir\ParentChild.hbm.xml"/>
-
- <mapping resource="mapping\unionsubclass\Beings.hbm.xml"/>
-
- <mapping resource="mapping\unionsubclass2\Person.hbm.xml"/>
-
- <mapping
resource="mapping\usercollection\basic\UserPermissions.hbm.xml"/>
-
- <mapping
resource="mapping\usercollection\parameterized\Mapping.hbm.xml"/>
-
- <mapping resource="mapping\util\dtd\Parent.hbm.xml"/>
-
- <mapping resource="mapping\version\PersonThing.hbm.xml"/>
-
- <mapping resource="mapping\version\db\User.hbm.xml"/>
-
- <mapping resource="mapping\where\File.hbm.xml"/>
- -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<!--
- <mapping
resource="mapping/propertyref/inheritence/joined/Person.hbm.xml"/>
--->
-
- </session-factory>
-</hibernate-configuration>
+ <p:mapping resource="mapping/onetomany/Parent.hbm.xml"/>
+
+ </p:session-factory>
+
+</p:hibernate-configuration>
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.hbm.xml
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.hbm.xml 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.hbm.xml 2011-11-19
00:53:14 UTC (rev 36463)
@@ -1,17 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<!--
-
- This mapping demonstrates how to use a composite
- element mapping to model a parent/child association.
-
--->
-
-<hibernate-mapping
- package="mapping.compositeelement">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+<hibernate-mapping package="mapping.compositeelement">
<import class="Child"/>
@@ -31,6 +22,4 @@
</composite-element>
</set>
</class>
-
-
</hibernate-mapping>
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/compositeelement/Parent.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -11,7 +11,7 @@
private Long id;
private String name;
private Collection children = new HashSet();
- Parent() {}
+ public Parent() {}
public Parent(String name) {
this.name = name;
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/cut/MonetoryAmountUserType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/cut/MonetoryAmountUserType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/cut/MonetoryAmountUserType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -10,7 +10,9 @@
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.BigDecimalType;
+import org.hibernate.type.CurrencyType;
import org.hibernate.type.Type;
import org.hibernate.usertype.CompositeUserType;
@@ -24,7 +26,7 @@
}
public Type[] getPropertyTypes() {
- return new Type[] { Hibernate.BIG_DECIMAL, Hibernate.CURRENCY };
+ return new Type[] { BigDecimalType.INSTANCE, CurrencyType.INSTANCE };
}
public Object getPropertyValue(Object component, int property) throws HibernateException
{
@@ -62,8 +64,8 @@
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session,
Object owner)
throws HibernateException, SQLException {
- BigDecimal amt = (BigDecimal) Hibernate.BIG_DECIMAL.nullSafeGet( rs, names[0] );
- Currency cur = (Currency) Hibernate.CURRENCY.nullSafeGet( rs, names[1] );
+ BigDecimal amt = (BigDecimal) BigDecimalType.INSTANCE.nullSafeGet( rs, names[0],session
);
+ Currency cur = (Currency) CurrencyType.INSTANCE.nullSafeGet( rs, names[1], session );
if (amt==null) return null;
return new MonetoryAmount(amt, cur);
}
@@ -73,8 +75,8 @@
MonetoryAmount ma = (MonetoryAmount) value;
BigDecimal amt = ma == null ? null : ma.getAmount();
Currency cur = ma == null ? null : ma.getCurrency();
- Hibernate.BIG_DECIMAL.nullSafeSet(st, amt, index);
- Hibernate.CURRENCY.nullSafeSet(st, cur, index+1);
+ BigDecimalType.INSTANCE.nullSafeSet(st, amt, index, session);
+ CurrencyType.INSTANCE.nullSafeSet(st, cur, index+1, session);
}
public Object deepCopy(Object value) throws HibernateException {
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/hql/ClassificationType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/hql/ClassificationType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/hql/ClassificationType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -1,5 +1,7 @@
package mapping.hql;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.IntegerType;
import org.hibernate.usertype.EnhancedUserType;
import org.hibernate.HibernateException;
import org.hibernate.Hibernate;
@@ -45,14 +47,14 @@
return x.hashCode();
}
- public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws
HibernateException, SQLException {
- Integer ordinal = ( Integer ) Hibernate.INTEGER.nullSafeGet( rs, names[0] );
+ public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session,
Object owner) throws HibernateException, SQLException {
+ Integer ordinal = ( Integer ) IntegerType.INSTANCE.nullSafeGet( rs, names[0],
session);
return Classification.valueOf( ordinal );
}
- public void nullSafeSet(PreparedStatement st, Object value, int index) throws
HibernateException, SQLException {
+ public void nullSafeSet(PreparedStatement st, Object value, int index,
SessionImplementor session) throws HibernateException, SQLException {
Integer ordinal = value == null ? null : new Integer( ( ( Classification ) value
).ordinal() );
- Hibernate.INTEGER.nullSafeSet( st, ordinal, index );
+ IntegerType.INSTANCE.nullSafeSet( st, ordinal, index, session );
}
public Object deepCopy(Object value) throws HibernateException {
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/instrument/domain/CustomBlobType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/instrument/domain/CustomBlobType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/instrument/domain/CustomBlobType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -9,6 +9,8 @@
import org.hibernate.HibernateException;
import org.hibernate.Hibernate;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.BinaryType;
import org.hibernate.usertype.UserType;
/**
@@ -18,17 +20,17 @@
/**
* {@inheritDoc}
*/
- public Object nullSafeGet(ResultSet rs, String names[], Object owner) throws
SQLException {
+ public Object nullSafeGet(ResultSet rs, String names[], SessionImplementor session,
Object owner) throws SQLException {
// cast just to make sure...
- return ( byte[] ) Hibernate.BINARY.nullSafeGet( rs, names );
+ return ( byte[] ) BinaryType.INSTANCE.nullSafeGet( rs, names[0], session );
}
/**
* {@inheritDoc}
*/
- public void nullSafeSet(PreparedStatement ps, Object value, int index) throws
SQLException, HibernateException {
+ public void nullSafeSet(PreparedStatement ps, Object value, int index,
SessionImplementor session) throws SQLException, HibernateException {
// cast just to make sure...
- Hibernate.BINARY.nullSafeSet( ps, ( byte[] ) value, index );
+ BinaryType.INSTANCE.nullSafeSet( ps, ( byte[] ) value, index,session );
}
/**
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/CustomPersister.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/CustomPersister.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/CustomPersister.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -2,37 +2,43 @@
package mapping.legacy;
import java.io.Serializable;
+import java.util.Comparator;
import java.util.Hashtable;
import java.util.Map;
-import java.util.Comparator;
import org.hibernate.EntityMode;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.LockMode;
+import org.hibernate.LockOptions;
import org.hibernate.MappingException;
-import org.hibernate.cache.CacheConcurrencyStrategy;
-import org.hibernate.cache.entry.CacheEntryStructure;
-import org.hibernate.cache.entry.UnstructuredCacheEntry;
-import org.hibernate.engine.CascadeStyle;
-import org.hibernate.engine.EntityKey;
-import org.hibernate.engine.Mapping;
-import org.hibernate.engine.SessionFactoryImplementor;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.engine.TwoPhaseLoad;
-import org.hibernate.event.EventSource;
-import org.hibernate.event.PostLoadEvent;
-import org.hibernate.event.PreLoadEvent;
+import org.hibernate.annotations.CacheConcurrencyStrategy;
+import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
+import org.hibernate.cache.spi.entry.CacheEntryStructure;
+import org.hibernate.cache.spi.entry.UnstructuredCacheEntry;
+import org.hibernate.engine.internal.TwoPhaseLoad;
+import org.hibernate.engine.spi.CascadeStyle;
+import org.hibernate.engine.spi.EntityKey;
+import org.hibernate.engine.spi.Mapping;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.engine.spi.ValueInclusion;
+import org.hibernate.event.spi.EventSource;
+import org.hibernate.event.spi.PostLoadEvent;
+import org.hibernate.event.spi.PreLoadEvent;
import org.hibernate.id.IdentifierGenerator;
import org.hibernate.id.UUIDHexGenerator;
+import org.hibernate.internal.util.compare.EqualsHelper;
import org.hibernate.mapping.PersistentClass;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.sql.QuerySelect;
import org.hibernate.sql.Select;
+import org.hibernate.tuple.entity.EntityMetamodel;
+import org.hibernate.tuple.entity.EntityTuplizer;
+import org.hibernate.type.StringType;
import org.hibernate.type.Type;
import org.hibernate.type.VersionType;
-import org.hibernate.util.EqualsHelper;
public class CustomPersister implements EntityPersister {
@@ -111,7 +117,7 @@
public Object[] getPropertyValuesToInsert(Object object, Map mergeMap,
SessionImplementor session)
throws HibernateException {
- return getPropertyValues( object, session.getEntityMode() );
+ return getPropertyValues( object, session.getEntityPersister(null,
object).getEntityMode() );
}
public void processInsertGeneratedProperties(Serializable id, Object entity, Object[]
state, SessionImplementor session) {
@@ -293,7 +299,7 @@
if (obj!=null) {
clone = (Custom) obj.clone();
TwoPhaseLoad.addUninitializedEntity(
- new EntityKey( id, this, session.getEntityMode() ),
+ new EntityKey( id, session.getEntityPersister(null, clone), null ),
clone,
this,
LockMode.NONE,
@@ -379,7 +385,7 @@
}
- private static final Type[] TYPES = new Type[] { Hibernate.STRING };
+ private static final Type[] TYPES = new Type[] { StringType.INSTANCE };
private static final String[] NAMES = new String[] { "name" }; //$NON-NLS-1$
private static final boolean[] MUTABILITY = new boolean[] { true };
private static final boolean[] GENERATION = new boolean[] { false };
@@ -409,7 +415,7 @@
* @see EntityPersister#getIdentifierType()
*/
public Type getIdentifierType() {
- return Hibernate.STRING;
+ return StringType.INSTANCE;
}
/**
@@ -624,4 +630,155 @@
return false;
}
+ @Override
+ public EntityRegionAccessStrategy getCacheAccessStrategy() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EntityMetamodel getEntityMetamodel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Serializable getIdentifier(Object arg0, SessionImplementor arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ValueInclusion[] getPropertyInsertGenerationInclusions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ValueInclusion[] getPropertyUpdateGenerationInclusions() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object instantiate(Serializable arg0, SessionImplementor arg1) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object load(Serializable arg0, Object arg1, LockOptions arg2,
+ SessionImplementor arg3) throws HibernateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void lock(Serializable arg0, Object arg1, Object arg2,
+ LockOptions arg3, SessionImplementor arg4)
+ throws HibernateException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void resetIdentifier(Object arg0, Serializable arg1, Object arg2,
+ SessionImplementor arg3) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setIdentifier(Object arg0, Serializable arg1,
+ SessionImplementor arg2) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public boolean isInstrumented() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean implementsLifecycle() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public Class getConcreteProxyClass() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void setPropertyValues(Object object, Object[] values) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setPropertyValue(Object object, int i, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public Object[] getPropertyValues(Object object) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getPropertyValue(Object object, int i)
+ throws HibernateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Serializable getIdentifier(Object object) throws HibernateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getVersion(Object object) throws HibernateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isInstance(Object object) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public boolean hasUninitializedLazyProperties(Object object) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public EntityPersister getSubclassEntityPersister(Object instance,
+ SessionFactoryImplementor factory) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EntityMode getEntityMode() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EntityTuplizer getEntityTuplizer() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/DoubleStringType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/DoubleStringType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/DoubleStringType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -9,7 +9,8 @@
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.StringType;
import org.hibernate.type.Type;
import org.hibernate.usertype.CompositeUserType;
@@ -50,8 +51,8 @@
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor
session, Object owner)
throws HibernateException, SQLException {
- String first = (String) Hibernate.STRING.nullSafeGet(rs, names[0]);
- String second = (String) Hibernate.STRING.nullSafeGet(rs, names[1]);
+ String first = (String) StringType.INSTANCE.nullSafeGet(rs, names[0], session);
+ String second = (String) StringType.INSTANCE.nullSafeGet(rs, names[1], session);
return ( first==null && second==null ) ? null : new String[] { first, second
};
}
@@ -61,8 +62,8 @@
String[] strings = (value==null) ? new String[2] : (String[]) value;
- Hibernate.STRING.nullSafeSet(st, strings[0], index);
- Hibernate.STRING.nullSafeSet(st, strings[1], index+1);
+ StringType.INSTANCE.nullSafeSet(st, strings[0], index, session);
+ StringType.INSTANCE.nullSafeSet(st, strings[1], index+1, session);
}
public String[] getPropertyNames() {
@@ -70,7 +71,7 @@
}
public Type[] getPropertyTypes() {
- return new Type[] { Hibernate.STRING, Hibernate.STRING };
+ return new Type[] { StringType.INSTANCE, StringType.INSTANCE };
}
public Object getPropertyValue(Object component, int property) {
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/MultiplicityType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/MultiplicityType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/legacy/MultiplicityType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -8,21 +8,34 @@
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
-import org.hibernate.engine.ForeignKeys;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.internal.ForeignKeys;
+import org.hibernate.engine.spi.SessionFactoryImplementor;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.type.IntegerType;
+import org.hibernate.type.ManyToOneType;
+import org.hibernate.type.StringType;
import org.hibernate.type.Type;
+import org.hibernate.type.TypeFactory;
import org.hibernate.usertype.CompositeUserType;
public class MultiplicityType implements CompositeUserType {
+ private static class NoScope implements TypeFactory.TypeScope {
+ public static final NoScope INSTANCE = new NoScope();
+
+ public SessionFactoryImplementor resolveFactory() {
+ throw new HibernateException( "Cannot access SessionFactory from here" );
+ }
+ }
+
private static final String[] PROP_NAMES = new String[] {
"count", "glarch" //$NON-NLS-1$ //$NON-NLS-2$
};
private static final int[] SQL_TYPES = new int[] {
- Hibernate.INTEGER.sqlType(), Hibernate.STRING.sqlType()
+ IntegerType.INSTANCE.sqlType(), StringType.INSTANCE.sqlType()
};
private static final Type[] TYPES = new Type[] {
- Hibernate.INTEGER, Hibernate.entity(Glarch.class)
+ IntegerType.INSTANCE, new ManyToOneType( NoScope.INSTANCE, Glarch.class.getName())
};
public String[] getPropertyNames() {
@@ -78,8 +91,8 @@
public Object nullSafeGet(ResultSet rs, String[] names, SessionImplementor session,
Object owner)
throws HibernateException, SQLException {
- Integer c = (Integer) Hibernate.INTEGER.nullSafeGet( rs, names[0] );
- GlarchProxy g = (GlarchProxy) Hibernate.entity(Glarch.class).nullSafeGet(rs, names[1],
session, owner);
+ Integer c = (Integer) IntegerType.INSTANCE.nullSafeGet( rs, names[0], session );
+ GlarchProxy g = (GlarchProxy) new ManyToOneType( NoScope.INSTANCE,
Glarch.class.getName()).nullSafeGet(rs, names[1], session, owner);
Multiplicity m = new Multiplicity();
m.count = c==null ? 0 : c.intValue();
m.glarch = g;
@@ -100,8 +113,8 @@
g = o.glarch;
c = new Integer(o.count);
}
- Hibernate.INTEGER.nullSafeSet(st, c, index, session);
- Hibernate.entity(Glarch.class).nullSafeSet(st, g, index+1, session);
+ IntegerType.INSTANCE.nullSafeSet(st, c, index, session);
+ new ManyToOneType( NoScope.INSTANCE, Glarch.class.getName()).nullSafeSet(st, g,
index+1, session);
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/rowid/RowIdType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/rowid/RowIdType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/rowid/RowIdType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -8,6 +8,7 @@
import java.sql.Types;
import org.hibernate.HibernateException;
+import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.UserType;
/**
@@ -31,16 +32,6 @@
return x.hashCode();
}
- public Object nullSafeGet(ResultSet rs, String[] names, Object owner)
- throws HibernateException, SQLException {
- return rs.getObject( names[0] );
- }
-
- public void nullSafeSet(PreparedStatement st, Object value, int index)
- throws HibernateException, SQLException {
- throw new UnsupportedOperationException();
- }
-
public Object deepCopy(Object value) throws HibernateException {
return value;
}
@@ -61,4 +52,17 @@
return null;
}
+ @Override
+ public Object nullSafeGet(ResultSet rs, String[] names,
+ SessionImplementor session, Object owner)
+ throws HibernateException, SQLException {
+ return rs.getObject( names[0] );
+ }
+
+ @Override
+ public void nullSafeSet(PreparedStatement st, Object value, int index,
+ SessionImplementor session) throws HibernateException, SQLException {
+ throw new UnsupportedOperationException();
+ }
+
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/typeparameters/DefaultValueIntegerType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/typeparameters/DefaultValueIntegerType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/typeparameters/DefaultValueIntegerType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -8,6 +8,7 @@
import java.util.Properties;
import org.hibernate.HibernateException;
+import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.usertype.ParameterizedType;
import org.hibernate.usertype.UserType;
@@ -33,19 +34,6 @@
return x.equals(y);
}
- public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws
HibernateException, SQLException {
- Number result = (Number) rs.getObject(names[0]);
- return result==null ? defaultValue : new Integer(result.intValue());
- }
-
- public void nullSafeSet(PreparedStatement st, Object value, int index) throws
HibernateException, SQLException {
- if (value == null || defaultValue.equals(value) ) {
- st.setNull(index, Types.INTEGER);
- } else {
- st.setInt(index, ((Integer)value).intValue());
- }
- }
-
public Object deepCopy(Object value) throws HibernateException {
return new Integer(((Integer)value).intValue());
}
@@ -76,4 +64,22 @@
this.defaultValue = Integer.valueOf((String) parameters.get("default"));
//$NON-NLS-1$
}
+ @Override
+ public Object nullSafeGet(ResultSet rs, String[] names,
+ SessionImplementor session, Object owner)
+ throws HibernateException, SQLException {
+ Number result = (Number) rs.getObject(names[0]);
+ return result==null ? defaultValue : new Integer(result.intValue());
+ }
+
+ @Override
+ public void nullSafeSet(PreparedStatement st, Object value, int index,
+ SessionImplementor session) throws HibernateException, SQLException {
+ if ( value == null || defaultValue.equals(value) ) {
+ st.setNull(index, Types.INTEGER);
+ } else {
+ st.setInt(index, ((Integer)value).intValue());
+ }
+ }
+
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/MyListType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/MyListType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/MyListType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -5,8 +5,8 @@
import org.hibernate.EntityMode;
import org.hibernate.HibernateException;
-import org.hibernate.collection.PersistentCollection;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.collection.spi.PersistentCollection;
+import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.usertype.UserCollectionType;
@@ -19,12 +19,7 @@
}
public PersistentCollection wrap(SessionImplementor session, Object collection) {
- if ( session.getEntityMode()==EntityMode.DOM4J ) {
- throw new IllegalStateException("dom4j not supported"); //$NON-NLS-1$
- }
- else {
- return new PersistentMyList( session, (IMyList) collection );
- }
+ return new PersistentMyList( session, (IMyList) collection );
}
public Iterator getElementsIterator(Object collection) {
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/PersistentMyList.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/PersistentMyList.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/basic/PersistentMyList.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -1,7 +1,7 @@
package mapping.usercollection.basic;
-import org.hibernate.collection.PersistentList;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.collection.internal.PersistentList;
+import org.hibernate.engine.spi.SessionImplementor;
public class PersistentMyList extends PersistentList implements IMyList {
@@ -12,7 +12,4 @@
public PersistentMyList(SessionImplementor session, IMyList list) {
super(session, list);
}
-
-
-
}
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/DefaultableListType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/DefaultableListType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/DefaultableListType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -1,16 +1,16 @@
package mapping.usercollection.parameterized;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.List;
-import org.hibernate.usertype.UserCollectionType;
-import org.hibernate.usertype.ParameterizedType;
-import org.hibernate.collection.PersistentCollection;
-import org.hibernate.engine.SessionImplementor;
-import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.EntityMode;
+import org.hibernate.collection.spi.PersistentCollection;
+import org.hibernate.engine.spi.SessionImplementor;
+import org.hibernate.persister.collection.CollectionPersister;
+import org.hibernate.usertype.ParameterizedType;
+import org.hibernate.usertype.UserCollectionType;
/**
* Our Hibernate type-system extension for defining our specialized collection
@@ -35,12 +35,7 @@
}
public PersistentCollection wrap(SessionImplementor session, Object collection) {
- if ( session.getEntityMode() == EntityMode.DOM4J ) {
- throw new IllegalStateException( "dom4j not supported" ); //$NON-NLS-1$
- }
- else {
return new PersistentDefaultableList( session, ( List ) collection );
- }
}
public Iterator getElementsIterator(Object collection) {
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/PersistentDefaultableList.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/PersistentDefaultableList.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/usercollection/parameterized/PersistentDefaultableList.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -2,8 +2,8 @@
import java.util.List;
-import org.hibernate.collection.PersistentList;
-import org.hibernate.engine.SessionImplementor;
+import org.hibernate.collection.internal.PersistentList;
+import org.hibernate.engine.spi.SessionImplementor;
/**
* The "persistent wrapper" around our specialized collection contract
Modified:
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/where/NumericTrueFalseType.java
===================================================================
---
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/where/NumericTrueFalseType.java 2011-11-19
00:48:27 UTC (rev 36462)
+++
branches/hibernatetools-multiversion2/sampleprojects/org.jboss.tools.hibernate4.sampleproject.mappingtypes/src/mapping/where/NumericTrueFalseType.java 2011-11-19
00:53:14 UTC (rev 36463)
@@ -29,7 +29,7 @@
}
}
- public void set(PreparedStatement st, Object value, int index) throws SQLException {
+ public void set(PreparedStatement st, Boolean value, int index) throws SQLException {
if ( value == null ) {
st.setNull( index, Types.INTEGER );
}
@@ -39,14 +39,10 @@
}
}
- public String objectToSQLString(Object value, Dialect dialect) throws Exception {
+ public String objectToSQLString(Boolean value, Dialect dialect) {
return ( ( Boolean ) value ).booleanValue() ? "1" : "0";
//$NON-NLS-1$ //$NON-NLS-2$
}
- public int sqlType() {
- return Types.INTEGER;
- }
-
public String getName() {
return "numeric_boolean"; //$NON-NLS-1$
}