[Hibernate-JIRA] Created: (HBX-982) HBM2JAVA w/ ejb3=true does not generate @IndexColumn annotation
by Parker Whirlow (JIRA)
HBM2JAVA w/ ejb3=true does not generate @IndexColumn annotation
---------------------------------------------------------------
Key: HBX-982
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-982
Project: Hibernate Tools
Issue Type: Bug
Components: hbm2java
Affects Versions: 3.2beta10
Environment: HibernateTools 3.2beta10
Reporter: Parker Whirlow
When using the HBM2JAVA tool with 'ejb3=true' to generate EJB annotations, a hibernate mapping consisting of an ordered List doesn't generate the @IndexColumn annotation in the resulting java class. See below:
Mapping document:
<hibernate-mapping package="com.company.ejb3.entity">
<union-subclass name="Person" table="person" extends="AbstractEntity">
<property name="firstName" column="first_name" not-null="true" type="string" length="150"></property>
<list name="addresses" table="person_addresses">
<key column="person" />
<list-index column="address_index" />
<many-to-many column="address" class="Address" />
</list>
</union-subclass>
</hibernate-mapping>
Resulting Person.java snippet:
@ManyToMany(fetch=FetchType.LAZY)
@JoinTable(name="person_addresses", joinColumns = {
@JoinColumn(name="person", nullable=false, updatable=false) }, inverseJoinColumns = {
@JoinColumn(name="address", nullable=false, updatable=false) })
public List<Address> getAddresses() {
return this.addresses;
}
public void setAddresses(List<Address> addresses) {
this.addresses = addresses;
}
The above should contain:
@IndexColumn(name="address_index")
--
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
14 years, 11 months
[Hibernate-JIRA] Created: (HBX-1034) Need a way to have a "native-if-not-assigned" IdentifierGenerator
by Paul Shemansky (JIRA)
Need a way to have a "native-if-not-assigned" IdentifierGenerator
-----------------------------------------------------------------
Key: HBX-1034
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1034
Project: Hibernate Tools
Issue Type: New Feature
Reporter: Paul Shemansky
Attachments: hibernate-native-or-assigned-patch.diff
NOTE: I believe I have explored every documented possibility in achieving the desired functionality. If I have misused Hibernate, the forum, or Google, I humbly apologize and stand to be corrected.
With that being said, I believe this may be desired:
--------------------------------------------------------------------
By setting the Hibernate configuration's primary key column to use a "native" implementation, Hibernate ALWAYS generates the entity's id when a save() is being called. There is no way to "override" the generated id.
The attached patch creates an IdentityGenerator which allows a programmer to override the "generated" id, with an "assigned" id at runtime simply by setting the primary key property.
The patch also changes the IdentifierGeneratorFactory to allow the short-name selection of the generator via a configuration file.
Furthermore, the English documentation is patched to describe the generator, accordingly.
Possibly related issues and reference material:
The documentation does not seem to provide a solution for a native-if-not-assigned generator; you seem to only have one, or the other:
http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-...
A scenario which describes a typical use case that warrants the proposed new feature:
http://forum.hibernate.org/viewtopic.php?t=982560&highlight=native+id+gen...
--
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
14 years, 11 months
[Hibernate-JIRA] Created: (HHH-4052) Bug when use COALESCE combined with CAST(null as VARCHAR)
by Wilson Penha (JIRA)
Bug when use COALESCE combined with CAST(null as VARCHAR)
---------------------------------------------------------
Key: HHH-4052
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4052
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.3.0.GA
Environment: Windows, Java1.5, Tomcat5.5.25, postgres8
Reporter: Wilson Penha
this expression bring me too much problem : COALESCE(CAST(p.birthDate AS VARCHAR)),''), birthDate is null in this case, so when I get a null value from a Date type or whatever other null value, it produce a NPE from CAST, so:
if I do COALESCE(p.dataNascimento,'') it's asking for a date value and bring me another error, so how can do that on HQL, bcz it works if I do the same directly on postgres.
I think this is a bug.
--
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
14 years, 11 months
[Hibernate-JIRA] Created: (HHH-4051) Issue with count(class) when class has a composite (@Embeddable) id
by kareem shabazz (JIRA)
Issue with count(class) when class has a composite (@Embeddable) id
-------------------------------------------------------------------
Key: HHH-4051
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4051
Project: Hibernate Core
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6 on Oracle 10g
Reporter: kareem shabazz
Priority: Minor
When performing this query [(Long)session.createQuery("select count(c) from " + clazz.getSimpleName() + " c").uniqueResult()], the following error occurs
15:34:52.954 [main] DEBUG org.hibernate.SQL -
select
count((contingenc0_.client_id,
contingenc0_.dataset_id,
contingenc0_.jurisdiction_id,
contingenc0_.unit_id)) as col_0_0_
from
ctg_rates contingenc0_
Hibernate:
select
count((contingenc0_.client_id,
contingenc0_.dataset_id,
contingenc0_.jurisdiction_id,
contingenc0_.unit_id)) as col_0_0_
from
ctg_rates contingenc0_
15:34:52.985 [main] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
15:34:52.985 [main] DEBUG o.h.util.JDBCExceptionReporter - could not execute query [select count((contingenc0_.client_id, contingenc0_.dataset_id, contingenc0_.jurisdiction_id, contingenc0_.unit_id)) as col_0_0_ from ctg_rates contingenc0_]
java.sql.SQLException: ORA-00907: missing right parenthesis
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
...
The 4 properties (clientId, datasetId, unitid, jurisdictionId) make up an class annotated with @Embeddable and is used as the @Id in class ContingencyRate. The query looks fine, I can't imagine what could possibly be wrong other than a bug. ContingencyRate is persisted and retrived from the db without an issue in the same integration test suite.
--
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
14 years, 11 months