From: <one...@us...> - 2003-03-29 04:09:19
|
Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate In directory sc8-pr-cvs1:/tmp/cvs-serv947/hibernate Modified Files: Hibernate.java Interceptor.java Session.java hibernate-mapping-2.0.dtd Log Message: * fixed a bug in SQLExpression * fixed a bug in Expression.ge() * improved proxy handling * fixed problems with select new * reworked import mechanism * added <any> mappings Index: Hibernate.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Hibernate.java 12 Mar 2003 12:28:57 -0000 1.8 --- Hibernate.java 29 Mar 2003 04:08:46 -0000 1.9 *************** *** 8,12 **** import java.sql.Blob; import java.sql.Clob; - import java.sql.SQLException; import net.sf.hibernate.collection.PersistentCollection; --- 8,11 ---- *************** *** 155,165 **** public static final NullableType CLASS = new ClassType(); /** - * Hibernate <tt>object</tt> type - */ - public static final Type OBJECT = new ObjectType(); - /** * Hibernate <tt>serializable</tt> type */ public static final NullableType SERIALIZABLE = new SerializableType(Serializable.class); --- 154,164 ---- public static final NullableType CLASS = new ClassType(); /** * Hibernate <tt>serializable</tt> type */ public static final NullableType SERIALIZABLE = new SerializableType(Serializable.class); + /** + * Hibernate <tt>object</tt> type + */ + public static final Type OBJECT = new ObjectType(); *************** *** 177,181 **** } /** ! * A Hibernate serializable type */ public static Type serializable(Class serializableClass) { --- 176,180 ---- } /** ! * A Hibernate <tt>serializable</tt> type */ public static Type serializable(Class serializableClass) { *************** *** 183,186 **** --- 182,192 ---- } /** + * A Hibernate <tt>any</tt> type + * @param identifierType the entity identifier type + */ + public static Type any(Type identifierType) { + return new ObjectType(identifierType); + } + /** * A Hibernate persistent object (entity) type * @param persistentClass a mapped entity class *************** *** 202,208 **** * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> * @throws HibernateException if we can't initialize the proxy at this time, eg. the <tt>Session</tt> was closed - * @throws SQLException */ ! public static void initialize(Object proxy) throws HibernateException, SQLException { if (proxy==null) { return; --- 208,213 ---- * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> * @throws HibernateException if we can't initialize the proxy at this time, eg. the <tt>Session</tt> was closed */ ! public static void initialize(Object proxy) throws HibernateException { if (proxy==null) { return; *************** *** 219,223 **** * Is the proxy or persistent collection initialized? * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> ! * @retrun true if the argument is already initialized, or is not a proxy or collection */ public static boolean isInitialized(Object proxy) { --- 224,228 ---- * Is the proxy or persistent collection initialized? * @param proxy a persistable object, proxy, persistent collection or <tt>null</tt> ! * @return true if the argument is already initialized, or is not a proxy or collection */ public static boolean isInitialized(Object proxy) { Index: Interceptor.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Interceptor.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Interceptor.java 9 Mar 2003 04:04:04 -0000 1.7 --- Interceptor.java 29 Mar 2003 04:08:46 -0000 1.8 *************** *** 89,93 **** * @param clazz a mapped class * @param id the identifier of the new instance ! * @return Object an instance of the class, or <tt>null</tt> to choose default behaviour */ public Object instantiate(Class clazz, Serializable id); --- 89,93 ---- * @param clazz a mapped class * @param id the identifier of the new instance ! * @return an instance of the class, or <tt>null</tt> to choose default behaviour */ public Object instantiate(Class clazz, Serializable id); Index: Session.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Session.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Session.java 22 Mar 2003 13:41:51 -0000 1.13 --- Session.java 29 Mar 2003 04:08:46 -0000 1.14 *************** *** 168,171 **** --- 168,178 ---- */ public Serializable getIdentifier(Object object) throws HibernateException; + /** + * Is this instance associated with this <tt>Session</tt>? + * + * @param object an instance of a persistent class + * @return true if the given instance is associated with this <tt>Session</tt> + */ + public boolean contains(Object object); /** Index: hibernate-mapping-2.0.dtd =================================================================== RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/hibernate-mapping-2.0.dtd,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** hibernate-mapping-2.0.dtd 16 Mar 2003 01:45:52 -0000 1.16 --- hibernate-mapping-2.0.dtd 29 Mar 2003 04:08:46 -0000 1.17 *************** *** 19,26 **** <!-- The document root. --> ! <!ELEMENT hibernate-mapping (meta*, class*, query*)> <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> --- 19,32 ---- <!-- The document root. --> ! <!ELEMENT hibernate-mapping (meta*, import*, class*, query*)> <!ATTLIST hibernate-mapping schema CDATA #IMPLIED> <!-- default: none --> <!ATTLIST hibernate-mapping default-cascade (none|save-update|all) "none"> ! ! <!-- A query language "import" --> ! ! <!ELEMENT import EMPTY> ! <!ATTLIST import class CDATA #REQUIRED> ! <!ATTLIST import rename CDATA #IMPLIED> <!-- default: unqualified class name --> ! <!-- Root of an entity class hierarchy. Entities have their own tables. --> *************** *** 31,35 **** discriminator?, (version|timestamp)?, ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)*, ((subclass*)|(joined-subclass*)) )> --- 37,41 ---- discriminator?, (version|timestamp)?, ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)*, ((subclass*)|(joined-subclass*)) )> *************** *** 43,46 **** --- 49,53 ---- <!ATTLIST class persister CDATA #IMPLIED> <!ATTLIST class dynamic-update (true|false) "false"> + <!ATTLIST class import CDATA #IMPLIED> <!-- Declares the id type, column and generation algorithm for an entity class. *************** *** 92,96 **** <!ELEMENT subclass ( meta*, ! (property|many-to-one|one-to-one|component|map|set|list|bag|array|primitive-array)*, subclass* )> --- 99,103 ---- <!ELEMENT subclass ( meta*, ! (property|many-to-one|one-to-one|component|any|map|set|list|bag|array|primitive-array)*, subclass* )> *************** *** 99,102 **** --- 106,110 ---- <!ATTLIST subclass discriminator-value CDATA #IMPLIED> <!-- default: unqualified class name | none --> <!ATTLIST subclass dynamic-update (true|false) "false"> + <!ATTLIST subclass import CDATA #IMPLIED> <!-- Joined subclasses are used for the normalized table-per-subclass mapping strategy --> *************** *** 105,109 **** meta*, key, ! (property|many-to-one|one-to-one|component|map|set|list|bag|array|primitive-array)*, joined-subclass* )> --- 113,117 ---- meta*, key, ! (property|many-to-one|one-to-one|component|any|map|set|list|bag|array|primitive-array)*, joined-subclass* )> *************** *** 113,116 **** --- 121,125 ---- <!ATTLIST joined-subclass schema CDATA #IMPLIED> <!ATTLIST joined-subclass dynamic-update (true|false) "false"> + <!ATTLIST joined-subclass import CDATA #IMPLIED> <!-- Property of an entity class or component, component-element, composite-id, etc. *************** *** 166,170 **** <!ATTLIST key-many-to-one class CDATA #IMPLIED> <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are --- 175,187 ---- <!ATTLIST key-many-to-one class CDATA #IMPLIED> <!ATTLIST key-many-to-one column CDATA #IMPLIED> ! ! <!-- An "any" association is a polymorphic association to any table with ! the given identifier type. The first listed column is a VARCHAR column ! holding the name of the class (for that row). --> ! ! <!ELEMENT any (column, column+)> ! <!ATTLIST any id-type CDATA #REQUIRED> ! <!ATTLIST any name CDATA #REQUIRED> ! <!-- A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are *************** *** 175,179 **** <!ELEMENT component ( parent?, ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> --- 192,196 ---- <!ELEMENT component ( parent?, ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)* )> <!ATTLIST component class CDATA #IMPLIED> *************** *** 181,185 **** <!ELEMENT dynabean ( ! (property|many-to-one|one-to-one|component|dynabean|map|set|list|bag|array|primitive-array)* )> <!ATTLIST dynabean dynaclass CDATA #REQUIRED> --- 198,202 ---- <!ELEMENT dynabean ( ! (property|many-to-one|one-to-one|component|dynabean|any|map|set|list|bag|array|primitive-array)* )> <!ATTLIST dynabean dynaclass CDATA #REQUIRED> |