-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problems with DefaultDeleteEventListener
PostPosted: Fri May 20, 2005 5:47 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hi togehter,
i use hibernate 3.0 and the newest version of hibernate annotations
My problem is the following: when i want to extend my class with DefaultDeleteEventListener i get the following error message (without the EventListener there is no problem...):

ERROR - could not complete schema update
org.hibernate.MappingException: Could not determine type for: org.apache.commons.logging.Log, for columns: [org.hibernate.mapping.Column(log)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:244)
at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:124)
at org.hibernate.mapping.Column.getSqlType(Column.java:168)
at org.hibernate.mapping.Table.sqlAlterStrings(Table.java:193)
at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:736)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:135)
at util.HibernateUtil.<clinit>(HibernateUtil.java:18)
at testcases.DeleteMomentIntervalTestCase.setUp(DeleteMomentIntervalTestCase.java:28)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)

My class, implementeting the Listener looks like that:
/**
* Stereotyp Moment-Interval
*/
@Entity(access = AccessType.FIELD)
@Table(name = "Uhr")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Uhr extends DefaultDeleteEventListener

{

public void onDelete(DeleteEvent event) throws CallbackException {
super.onDelete(event);

}
}

My Class, opening the session looks like that:
public class HibernateUtil {

private static final SessionFactory sessionFactory;
private static final AnnotationConfiguration cfg;

static {
try {
cfg = new AnnotationConfiguration();
cfg.configure();
new SchemaUpdate(cfg).execute(true, true);
sessionFactory = cfg.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 final ThreadLocal session = new ThreadLocal();

public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
// Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}

public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
}

In an extern test class, I call simply session = HibernateUtil.currentSession(); to open a new session.
And here i get the problem.
Can somebody help me?


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 20, 2005 6:38 am 
Beginner
Beginner

Joined: Mon Mar 21, 2005 1:39 pm
Posts: 28
Hallo!
I solved the problem!

Regards,
Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.