Update of /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate
In directory sc8-pr-cvs1:/tmp/cvs-serv27355/src/net/sf/hibernate
Modified Files:
Hibernate.java Query.java
Log Message:
include hibernate.properties in src dir
fix classpaths of batch scripts
Query.setEntity(), etc now proxy-aware
Query.guessType() now handles serializable entities properly
Index: Hibernate.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Hibernate.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Hibernate.java 8 Mar 2003 06:31:22 -0000 1.7
--- Hibernate.java 12 Mar 2003 12:28:57 -0000 1.8
***************
*** 217,220 ****
--- 217,237 ----
/**
+ * 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) {
+ if ( proxy instanceof HibernateProxy ) {
+ return !HibernateProxyHelper.getLazyInitializer( (HibernateProxy) proxy ).isUninitialized();
+ }
+ else if ( proxy instanceof PersistentCollection ) {
+ return ( (PersistentCollection) proxy ).wasInitialized();
+ }
+ else {
+ return true;
+ }
+ }
+
+ /**
* Create a new <tt>Blob</tt>. The returned object will be
* initially immutable.
Index: Query.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate2/src/net/sf/hibernate/Query.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Query.java 9 Mar 2003 04:04:05 -0000 1.9
--- Query.java 12 Mar 2003 12:28:58 -0000 1.10
***************
*** 253,257 ****
* @param val a non-null instance of a persistent class
*/
! public Query setEntity(int position, Object val); // use setParameter for null values
/**
* Bind an instance of a persistent enumeration class to a JDBC-style query parameter.
--- 253,257 ----
* @param val a non-null instance of a persistent class
*/
! public Query setEntity(int position, Object val) throws HibernateException; // use setParameter for null values
/**
* Bind an instance of a persistent enumeration class to a JDBC-style query parameter.
***************
*** 267,271 ****
* @param val a non-null instance of a persistent class
*/
! public Query setEntity(String name, Object val); // use setParameter for null values
/**
* Bind an instance of a mapped persistent enumeration class to a named query parameter.
--- 267,271 ----
* @param val a non-null instance of a persistent class
*/
! public Query setEntity(String name, Object val) throws HibernateException; // use setParameter for null values
/**
* Bind an instance of a mapped persistent enumeration class to a named query parameter.
|