Hi,
I have a project that uses hibernate-core 3.6.10.Final/javassist-3.17.1-GA,
and I have some tests that use h2 1.3.159 (updating to 1.3.171 didn't make
a difference). I want to instrument some classes
using org.hibernate.tool.instrument.javassist.InstrumentTask, in order to
be able to do some lazy loading. If I do not instrument my classes (or
instrument them after the tests are run), all tests pass. But if I
instrument my classes before running the tests, some tests fail:
org.hibernate.exception.SQLGrammarException: could not load an entity:
[SomeEntity#1]
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
...
Caused by: org.h2.jdbc.JdbcSQLException: Column "device7_7_0_" not found
[42122-159]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:169)
at org.h2.message.DbException.get(DbException.java:146)
at org.h2.jdbc.JdbcResultSet.getColumnIndex(JdbcResultSet.java:2887)
at org.h2.jdbc.JdbcResultSet.get(JdbcResultSet.java:2963)
at org.h2.jdbc.JdbcResultSet.getLong(JdbcResultSet.java:622)
The relevant entities look like this:
@Entity
@Table(name="SomeName")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "SomeDiscriminatorColumn")
@DiscriminatorValue("SomeGenericValue")
public class SomeEntity {
@OneToOne(fetch = FetchType.LAZY)
@ForeignKey(name = "fk_name")
@LazyToOne(value = LazyToOneOption.NO_PROXY)
private SomeOtherEntity device;
...
}
@Entity
@Table(name = "SomeOtherName")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "SomeOtherDiscriminatorColumn")
@DiscriminatorValue("SomeOtherGenericValue")
public class SomeOtherEntity {
@OneToOne(mappedBy = "device", fetch = FetchType.LAZY)
@LazyToOne(value = LazyToOneOption.NO_PROXY)
private SomeEntity someEntity;
...
}
Is h2 capable of working with classes instrumented
by org.hibernate.tool.instrument.javassist.InstrumentTask? If it is, does
anybody know what might be causing this problem?
Thanks!
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.