[Hibernate-JIRA] Created: (HBX-812) Fetching Children of Database _crawls_.
by Syd Poetry (JIRA)
Fetching Children of Database _crawls_.
---------------------------------------
Key: HBX-812
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-812
Project: Hibernate Tools
Type: Bug
Components: reverse-engineer
Versions: 3.2beta8
Environment: MySQL 5.0, Eclipse 3.2, JDK 1.5, Beta8 for Hibernate Tools
Reporter: Syd Poetry
I just updated a bunch of components for Eclipse (mostly related to Visual Editor); added a couple of tables to my database, went to regenerate all the POJO clases .hbm.xml mapping files, and found that anything that queries the database schema runs abysmally slow.
Updated the tools from beta6 to beta8 thinking it might be a conflict with one of the updates that was performed, still very slow (5+ minutes to retrieve a list of tables!). Deleted all my hibernate-related XML files thinking it might be a parsing error, went to generate a new console file, and revenge.xml, found out that any listbox that tried to access the schema appeared to be hanging. It finishes after much hard-drive crunching. I have 2.2 GBs free running windows XP, MEM usage is 856 MB out of 1.5 GB physical memory. Just out of curiousity, is *anyone* else having this slow response for schema detection? I'm wondering if I have to update another component like a driver or something like that.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (HHH-3362) NullPointerException in org.hibernate.dialect.Dialect$2.getReturnType
by Istvan Kovacs (JIRA)
NullPointerException in org.hibernate.dialect.Dialect$2.getReturnType
---------------------------------------------------------------------
Key: HHH-3362
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3362
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.6
Environment: Hibernate Core 3.6.2 GA, hsqldb
Reporter: Istvan Kovacs
Attachments: bug_src.zip
java.lang.NullPointerException
at org.hibernate.dialect.Dialect$2.getReturnType(Dialect.java:85)
at org.hibernate.hql.ast.util.SessionFactoryHelper.findFunctionReturnType(SessionFactoryHelper.java:382)
at org.hibernate.hql.ast.tree.AggregateNode.getDataType(AggregateNode.java:21)
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:143)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:705)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:529)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:645)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at org.hibernate.console.HQLQueryPage.setSession(HQLQueryPage.java:106)
at org.hibernate.console.ConsoleConfiguration$4.execute(ConsoleConfiguration.java:388)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:383)
[...]
3 classes:
Employee: Long ID; String name; Shop shop
Shop: Long ID; String name; Set<Employee> employees; Map<Product, Integer> stock
Product: Long ID; String name
I mapped them to RDBMS using Hibernate. There's a table to hold stock info:
SHOP_PRODUCT_STOCK - has fields SHOP_ID, PRODUCT_ID, AMOUNT
SQL to query the average stock of each product:
select p.name as name, avg(sps.amount) as avg_stock
from Shop s, Shop_Product_Stock sps, Product p
where sps.product_id=p.product_id and sps.product_id=p.product_id
group by p.name
order by p.name;
Attempt in HQL that the produces exception:
select p, avg(s.stock[p])
from Shop s, Product p
group by p
I've also tried SELECTing and GROUPing BY p.id and p.name. None of the three variants work.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (HHH-3759) c3p0 not starting with v3.3.1
by Mark Strecker (JIRA)
c3p0 not starting with v3.3.1
-----------------------------
Key: HHH-3759
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3759
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: 3.3.1GA
MySQL 5.0.45
Reporter: Mark Strecker
Using the hibernate.c3p0.* properties in the hibernate.cfg.xml file used to start c3p0 but now the built-in connection pool is used instead.
You can set : <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
to work around this, but this is not necessary in 3.2.5GA and before. This also isn't documented anywhere and I fortunately found it in the forum.
Here is an example section in the hibernate.cfg.xml
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">100</property> <!-- seconds -->
<property name="hibernate.c3p0.max_size">100</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.c3p0.min_size">1</property>
<property name="hibernate.c3p0.timeout">100</property> <!-- seconds -->
We discovered this while upgrading from 3.2.5GA to 3.3.1GA when the connections on our test server started getting JDBC Connection errors because MySQL kills them after 8 hours of inactivity.
This can be verified by turning on hibernate info logging and examining the log.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (HBX-1082) Creating a formula property when reverse engineering
by Anders Reinhardt Hansen (JIRA)
Creating a formula property when reverse engineering
----------------------------------------------------
Key: HBX-1082
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1082
Project: Hibernate Tools
Issue Type: Improvement
Components: reverse-engineer
Affects Versions: 3.2.beta11
Environment: All environments
Reporter: Anders Reinhardt Hansen
Priority: Minor
Having lots of formula properties in mapping files is quite frustrating when reverse engineering database changes.
Therefore it would be a big help if there was a way to write formula properties in the Hibernate Reverse Engineering files.
A property formula is a property of a mapping file which is calculated by hibernate.
I.e.
<class name="XXX">
<column name="xxx" type="xxx" formula="(coloumn1+coloumn2)/coloumn3"/>
</class>
the reveng file could look like this
<hibernate-reverse-engineering>
...
<formula name="xxx" type="xxx" formula="(coloumn1+coloumn2)/coloumn3"/>
</hibernate-reverse-engineering>
Maybe the reverse engineering file is not the correct place for this feature. Suggestions are welcome
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (ANN-824) Annotations - MSSQL, DB2, Sybase - Nullable Foreign PK not allowed
by Gail Badner (JIRA)
Annotations - MSSQL, DB2, Sybase - Nullable Foreign PK not allowed
------------------------------------------------------------------
Key: ANN-824
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-824
Project: Hibernate Annotations
Issue Type: Bug
Environment: MSSQL, DB2, Sybase
Reporter: Gail Badner
Assignee: Emmanuel Bernard
Fix For: 3.5
MSSQL, DB2, and Sybase require primary key columns to be non-nullable. Some unit tests are failing using those DBs because a primary keys are defined with one or more nullable columns. This is happening with both trunk and v3_3_1_GA_CP.
I see other JIRA issues that sound related that are marked as fixed, so I'm surprised to see these failing in trunk.
HHH-1935 sounds related. It mentions a bug in SchemaUpdate using @MapKey with @CollectionOfElements.
Workarounds are:
- add "nullable=false" to @JoinColumn
- add "optional=false" to @ManyToOne
- add an @AttributeOverride with @Column(name="mapkey", nullable=false) in case of a @CollectionOfElements using a Map
- add "nullable=false" in @Column when inside a @CollectionId or inside @MapKey
I've included the table DDL causing the failure. Also, there were some tests I couldn't get to pass using a workaround.
org.hibernate.test.annotations.any.AnyTest
create table map_properties ( map_id int not null, property_type varchar(255) null,
property_id int not null, map_key varchar(255) null, primary key (map_id, map_key) )
org.hibernate.test.annotations.cid.CompositeIdTest
create table A ( bid numeric(19,0) null, cid numeric(19,0) null, primary key (bid, cid) )
create table Child ( nth int not null, parentFirstName varchar(255) null, parentLastName varchar(255) null,
primary key (nth, parentFirstName, parentLastName) )
create table TvMagazin ( time datetime null, chan_id int null, presenter_name varchar(255) null,
primary key (chan_id, presenter_name) )
create table TvProgram ( time datetime null, channel_id int null, presenter_name varchar(255) null,
primary key (channel_id, presenter_name) )
create table TvProgramIdClass ( time datetime null, channel_id int null, presenter_name varchar(255) null,
primary key (channel_id, presenter_name) )
org.hibernate.test.annotations.collectionelement.CollectionElementTest
create table Matrix_values ( Matrix_id int not null, element float null, mapkey int null,
primary key (Matrix_id, mapkey) )
create table ScorePerNickName ( BoyId int not null, fld_score int null, mapkey varchar(255) null,
primary key (BoyId, mapkey) )
create table TestCourse_variations ( TestCourse_testCourseId numeric(19,0) not null,
element varchar(255) null, language_code varchar(255) null,
primary key (TestCourse_testCourseId, language_code) )
org.hibernate.test.annotations.collectionelement.indexedCollection.IndexedCollectionOfElementsTest.testIndexedCollectionOfElements
create table contact ( n_key_person int not null, name varchar(255) null, n_key_contact numeric(19,0) null,
primary key (n_key_contact) )
org.hibernate.test.annotations.identifiercollection.IdentifierCollectionTest.testIdBag
NOTE: I could not find a workaround to fix this test.
create table PASSPORT_STAMP ( Passport_passport_id numeric(19,0) not null,
stamps_id numeric(19,0) not null, COLLECTION_ID numeric(19,0) null,
primary key (COLLECTION_ID) )
create table PASSPORT_VISASTAMP ( Passport_passport_id numeric(19,0) not null,
visaStamp_id numeric(19,0) not null, COLLECTION_ID numeric(19,0) null,
primary key (COLLECTION_ID) )
org.hibernate.test.annotations.indexcoll.IndexedCollectionTest
create table Atmosphere_Gas ( Atmosphere_id int not null, gases_id int not null,
gas_name varchar(255) null, primary key (Atmosphere_id, gas_name) )
org.hibernate.test.annotations.target.TargetTest
NOTE: I could not find a workaround to fix this test.
create table Brand_LuggageImpl ( Brand_id numeric(19,0) not null,
luggagesBySize_id numeric(19,0) not null, name varchar(255) null,
primary key (Brand_id, name) )
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months
[Hibernate-JIRA] Created: (HV-138) JPAValidateListener checks @NotNull fields that are filled after the @PrePersist call
by Julien Kronegg (JIRA)
JPAValidateListener checks @NotNull fields that are filled after the @PrePersist call
-------------------------------------------------------------------------------------
Key: HV-138
URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-138
Project: Hibernate Validator
Issue Type: Bug
Affects Versions: 3.1.0.GA
Environment: Hibernate 3.3.1.GA, Hibernate annotations 3.4.0.GA, Hibernate entity manager 3.4.0.GA, POJO annotated entities, DB2
Reporter: Julien Kronegg
According to Hibernate validation documentation ( http://www.hibernate.org/hib_docs/validator/reference/en/html_single/#val... ) we can annotate an entity with @EntityListeners({JPAValidateListener.class}) to validate the fields using the @PrePersist / @PreUpdate JPA events handlers.
I tryied with the following entity:
@Entity
@Table(...)
@EntityListeners({JPAValidateListener.class})
public class A {
private int id;
private String text;
@Id
@Column(...)
@NotNull
@GeneratedValue(...)
@GenericGenerator(...)
public int getId() { return id; }
public void setId(int id) { this.id=id; }
...
}
Problem is that the @PrePersist event is raised before some fields are automatically filled (e.g. @Id annotated). So the JPAValidateListener raises an exception saying that the identifier cannot be null.
The exception root cause detail is (InvalidState: id cannot be null) and the stacktrace is:
org.hibernate.validator.InvalidStateException: validation failed for : my.package.A
at org.hibernate.validator.ClassValidator.assertValid(ClassValidator.java:666)
at org.hibernate.validator.event.JPAValidateListener.onChange(JPAValidateListener.java:62)
...// some reflection StacktraceElement
at org.hibernate.ejb.event.ListenerCallback.invoke(ListenerCallback.java:31)
at org.hibernate.ejb.event.EntityCallbackHandler.callback(EntityCallbackHandler.java:80)
at org.hibernate.ejb.event.EntityCallbackHandler.preCreate(EntityCallbackHandler.java:49)
at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:48)
at org.hibernate.event.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)
...
The EJB3PersistEventListener.saveWithGeneratedId() method looks like:
protected Serializable saveWithGeneratedId(...) {
callbackHandler.preCreate(entity); // raises the @PrePersist JPA event
return super.saveWithGeneratedId(...); // sets the identifier
}
Thus, the JPAValidateListener validates the whole Entity and does not take the entity lifecycle into account. The JPAValidateListener should check all fields except the ones which are known to be modified/setled after the call to the validator.
This may also be the case for other generated fields such as the ones annotated with @Version (I did not check that).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months