Update of /cvsroot/hibernate/Hibernate/cirrus/hibernate/id
In directory sc8-pr-cvs1:/tmp/cvs-serv18672/hibernate/id
Modified Files:
Assigned.java IDGenerationException.java
IdentifierGenerator.java
Added Files:
IdentifierGenerationException.java
Removed Files:
Adaptor.java IDGenerator.java
Log Message:
removed deprecated IDGenerator interface, renamedand improved the exception class
--- NEW FILE: IdentifierGenerationException.java ---
//$Id: IdentifierGenerationException.java,v 1.1 2002/12/25 06:57:57 oneovthafew Exp $
package cirrus.hibernate.id;
import cirrus.hibernate.*;
/**
* Thrown by <tt>IdentifierGenerator</tt> implementation class when
* ID generation fails.
*
* @see IdentifierGenerator
*/
public class IdentifierGenerationException extends HibernateException {
public IdentifierGenerationException(String msg) {
super(msg);
}
public IdentifierGenerationException(String msg, Throwable t) {
super(msg, t);
}
}
Index: Assigned.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/id/Assigned.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Assigned.java 24 Nov 2002 11:00:36 -0000 1.11
--- Assigned.java 25 Dec 2002 06:57:57 -0000 1.12
***************
*** 19,27 ****
public Serializable generate(SessionImplementor session, Object obj) throws HibernateException {
! if (obj instanceof PersistentCollection) throw new IDGenerationException(
"Illegal use of assigned id generation for a toplevel collection"
);
final Serializable id = session.getPersister(obj).getIdentifier(obj);
! if (id==null) throw new IDGenerationException(
"ids for this class must be manually assigned before calling save(): " + obj.getClass().getName()
);
--- 19,27 ----
public Serializable generate(SessionImplementor session, Object obj) throws HibernateException {
! if (obj instanceof PersistentCollection) throw new IdentifierGenerationException(
"Illegal use of assigned id generation for a toplevel collection"
);
final Serializable id = session.getPersister(obj).getIdentifier(obj);
! if (id==null) throw new IdentifierGenerationException(
"ids for this class must be manually assigned before calling save(): " + obj.getClass().getName()
);
Index: IDGenerationException.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/id/IDGenerationException.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** IDGenerationException.java 25 Aug 2002 07:42:54 -0000 1.8
--- IDGenerationException.java 25 Dec 2002 06:57:57 -0000 1.9
***************
*** 2,19 ****
package cirrus.hibernate.id;
- import cirrus.hibernate.*;
-
/**
! * Thrown by <tt>IdentifierGenerator</tt> implementation class when
! * ID generation fails.
! *
! * @see IDGenerator
*/
!
! public class IDGenerationException extends HibernateException {
public IDGenerationException(String s) {
super(s);
}
!
}
--- 2,14 ----
package cirrus.hibernate.id;
/**
! * @deprecated use <tt>IdentifierGenerationException</tt>
! * @see IdentifierGenerationException
*/
! public class IDGenerationException extends IdentifierGenerationException {
public IDGenerationException(String s) {
super(s);
}
!
}
Index: IdentifierGenerator.java
===================================================================
RCS file: /cvsroot/hibernate/Hibernate/cirrus/hibernate/id/IdentifierGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IdentifierGenerator.java 1 Oct 2002 01:25:29 -0000 1.2
--- IdentifierGenerator.java 25 Dec 2002 06:57:57 -0000 1.3
***************
*** 31,35 ****
* @return Serializable a new identifier
* @throws SQLException
! * @throws IDGenerationException
*/
public Serializable generate(SessionImplementor session, Object object) throws SQLException, HibernateException;
--- 31,35 ----
* @return Serializable a new identifier
* @throws SQLException
! * @throws IdentifierGenerationException
*/
public Serializable generate(SessionImplementor session, Object object) throws SQLException, HibernateException;
--- Adaptor.java DELETED ---
--- IDGenerator.java DELETED ---
|