[Hibernate-JIRA] Created: (HBX-757) Add output file name, delimiter, halt on error, and format options to SchemaUpdate/<hbm2ddl>
by Dan Ports (JIRA)
Add output file name, delimiter, halt on error, and format options to SchemaUpdate/<hbm2ddl>
--------------------------------------------------------------------------------------------
Key: HBX-757
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-757
Project: Hibernate Tools
Type: Improvement
Components: ant
Versions: 3.2beta7
Reporter: Dan Ports
Priority: Minor
The file name, delimiter, halt on error, and format options are provided by SchemaExport/<hbm2ddl> already, so it makes sense to add their functionality to SchemaUpdate as well. I'll submit a patch shortly. (Is this the right place to post this, since SchemaUpdate is in the Hibernate core SVN?)
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (HBX-1102) @Temporal Annotation not generated in Composite-ID-Pojo
by Nils M (JIRA)
@Temporal Annotation not generated in Composite-ID-Pojo
-------------------------------------------------------
Key: HBX-1102
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1102
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2.4 Beta1
Environment: Database: DB2
Hibernate-Tools: 3.2.4.Beta1, Hibernate-Tools.3.2.4.CR1
Reporter: Nils M
We do have a problem with generating pojos from a DB using hibernate tools.
We have several tables with a composite ID, e.g. in table T100 these are the fields 'DATE_FROM' and 'UB_ID'. The Hibernate Tool generate the following pojos from that table. The problem we have is, that within the first class the Annotation '@Temporal' is used, but in the second class the Annotation is missing. The DB (IBM DB2) responds with an error without this Annotation.
We used the Hibernate Tools 3.2.4.Beta1 and 3.2.4.CR1. The result is the same with both versions.
Table T100Ub
===========
@Entity
@Table(name="T100_UB"
)
public class T100Ub implements java.io.Serializable {
private T100UbId id;
private Date dateUntil;
....
@Temporal(TemporalType.DATE)
@Column(name="DATE_UNTIL", nullable=false, length=10)
public Date getDateUntil() {
return this.dateUntil;
}
...
}
Table T100UbId
=============
@Embeddable
public class T100UbId implements java.io.Serializable {
private int ubId;
private Date dateFrom;
...
@Column(name="DATE_FROM", nullable=false, length=10)
public Date getDateFrom() {
return this.dateFrom;
}
...
}
Thanks a lot in advance!
--
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
15 years, 7 months
[Hibernate-JIRA] Created: (EJB-362) JPA Max/Min aggregate functions do not return same state-field type when argument is a java.sql.Timestamp
by josef (JIRA)
JPA Max/Min aggregate functions do not return same state-field type when argument is a java.sql.Timestamp
---------------------------------------------------------------------------------------------------------
Key: EJB-362
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-362
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.3.2.GA
Environment: JDK 1.6, Postgres 8.2, JDBC 4
Reporter: josef
According the JPQL specification, MAX and MIN aggregate functions should return the type of the state-field to which they are applied. However, if one tries to query MAX or MIN on a java.sql.Timestamp entity field and tries to populate a class which expects a java.sql.Timestamp in the constructor with the result of MAX or MIN, Hibernate fails with javax.persistence.PersistenceException. The result of MAX or MIN in this case are being java.util.Date instead.
The error result in type mismatch should ideally also be more helpful, because it is very difficult to understand what and where the problem is, unless you know about it beforehand.
Here is an example Entity, with the aggregate class and query, together with the exception that occurs:
...
import java.sql.Timestamp;
@Entity
@Table(name="pending_events")
public class PendingEvent implements Serializable
{
...
@Column(name="event_time", updatable=false, nullable=false)
private Timestamp eventTime;
...
}
import java.sql.Timestamp;
public class EventEntry
{
private String sender;
private Timestamp lastEventTime;
public EventEntry(String sender, Timestamp lastEventTime)
{
this.sender= sender;
this.lastEventTime = lastEventTime;
}
...
}
SELECT NEW mt.com.jbx.EventEntry(p.sender, MAX(p.eventTime)) FROM PendingEvent p WHERE p.recipient.id=? GROUP BY p.sender ORDER BY MAX(p.eventTime) DESC
java.lang.ExceptionInInitializerError
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: EventsPU] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
at mt.com.jbx.EventHandler.<clinit>(EventHandler.java:33)
Caused by: org.hibernate.HibernateException: Errors in named queries: getEventSummary
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:365)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
--
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
15 years, 7 months