[Hibernate-JIRA] Commented: (HHH-879) Enable joining the same association twice with Criteria
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-879?page=co... ]
Steve Ebersole commented on HHH-879:
------------------------------------
Actually Aleksei I am not sure whether this is simple to fix or not. On the surface it seems simple, but this goes against the entire original conceptualization of what a Criteria is. As mentioned here and elsewhere, the original conceptualization of a Criteria is a natural extension of a Loader (the thing used behind the scenes when you invoke get() or load()). Such changes against the entire conceptualization of a thing tend to be insidious.
The reason I have been leery of putting time and effort into this is because I actually envision a much different way to process criteria queries longer term based on the on-going work on the HQL translator and consolidating code (and capabilities) between the two. However, that work is not scheduled for completion until 3.3 and is only pre-requisite work for this. Plus moving Criteria translation and rendering to this format would mean an API change from the perspective of custom Criteria components (Criterion, Projection, etc) because you would no longer render to a String, but to a Node/AST. So that effects the release timeframe as well since it will require a major release. We'll have to discuss that on the dev list as to whether this can all fit into a 3.3 timeframe (which I doubt given current resourcing) or needs to push out to a later release.
> Enable joining the same association twice with Criteria
> -------------------------------------------------------
>
> Key: HHH-879
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-879
> Project: Hibernate3
> Type: Improvement
> Components: core
> Reporter: Vladimir Bayanov
>
>
> Make double joining the same association with Criteria.createCriteria possible. See: http://forum.hibernate.org/viewtopic.php?t=931249
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (HBX-688) hbm2java is not generating the @Version annotation for the <version ...> element
by Stephen Longo (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-688?page=co... ]
Stephen Longo commented on HBX-688:
-----------------------------------
Hi Max,
I have to admit: I never used junit or any kind of testing framework! :(
I tried having a look at tests already there, but couldn't really understand how to integrate validation for my code.
Hope you still appreciate the patch I've attached. BTW, please be aware that I'm a newbie so double check carefully my code! ;)
If somebody ever submits a test case for this patch, I'd like to see it (for future reference!).
Kindest regards,
Stephen Longo
> hbm2java is not generating the @Version annotation for the <version ...> element
> --------------------------------------------------------------------------------
>
> Key: HBX-688
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-688
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.1.beta5
> Reporter: Sean Dawson
> Attachments: BasicPOJOClass.patch
>
>
> See http://forum.hibernate.org/viewtopic.php?p=2310547#2310547
> Given a mapping file:
> ----
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated Jun 13, 2006 3:27:21 PM by Hibernate Tools 3.1.0.beta5 -->
> <hibernate-mapping>
> <class name="Sample" table="Sample">
> <id name="id" type="java.lang.Long">
> <column name="id" />
> <generator class="native" />
> </id>
> <version name="version" column="version"/>
> <property name="value" column="value" type="string"/>
> </class>
> </hibernate-mapping>
> ----
> the following ejb is generated (via hbm2java, ejb3="true", jdk5="true":
> ----
> // default package
> // Generated Jun 16, 2006 3:23:35 PM by Hibernate Tools 3.1.0.beta5
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.Id;
> import javax.persistence.Table;
> /**
> * Sample generated by hbm2java
> */
> @Entity
> @Table(name="Sample"
> )
> public class Sample implements java.io.Serializable {
> // Fields
> private Long id;
> private Integer version;
> private String value;
> // Constructors
> /** default constructor */
> public Sample() {
> }
> /** full constructor */
> public Sample(String value) {
> this.value = value;
> }
>
>
> // Property accessors
> @Id @GeneratedValue
>
> @Column(name="id", unique=false, nullable=false, insertable=true, updatable=true)
> public Long getId() {
> return this.id;
> }
>
> public void setId(Long id) {
> this.id = id;
> }
>
> @Column(name="version", unique=false, nullable=false, insertable=true, updatable=true)
> public Integer getVersion() {
> return this.version;
> }
>
> public void setVersion(Integer version) {
> this.version = version;
> }
>
> @Column(name="value", unique=false, nullable=true, insertable=true, updatable=true)
> public String getValue() {
> return this.value;
> }
>
> public void setValue(String value) {
> this.value = value;
> }
> }
> -----
> There should be a @Version annotation on the version property!
--
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
17 years, 10 months
[Hibernate-JIRA] Updated: (HBX-688) hbm2java is not generating the @Version annotation for the <version ...> element
by Stephen Longo (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-688?page=all ]
Stephen Longo updated HBX-688:
------------------------------
Attachment: BasicPOJOClass.patch
Submitting patch for evaluation.
Kind regards,
Stephen Longo
> hbm2java is not generating the @Version annotation for the <version ...> element
> --------------------------------------------------------------------------------
>
> Key: HBX-688
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-688
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.1.beta5
> Reporter: Sean Dawson
> Attachments: BasicPOJOClass.patch
>
>
> See http://forum.hibernate.org/viewtopic.php?p=2310547#2310547
> Given a mapping file:
> ----
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated Jun 13, 2006 3:27:21 PM by Hibernate Tools 3.1.0.beta5 -->
> <hibernate-mapping>
> <class name="Sample" table="Sample">
> <id name="id" type="java.lang.Long">
> <column name="id" />
> <generator class="native" />
> </id>
> <version name="version" column="version"/>
> <property name="value" column="value" type="string"/>
> </class>
> </hibernate-mapping>
> ----
> the following ejb is generated (via hbm2java, ejb3="true", jdk5="true":
> ----
> // default package
> // Generated Jun 16, 2006 3:23:35 PM by Hibernate Tools 3.1.0.beta5
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.Id;
> import javax.persistence.Table;
> /**
> * Sample generated by hbm2java
> */
> @Entity
> @Table(name="Sample"
> )
> public class Sample implements java.io.Serializable {
> // Fields
> private Long id;
> private Integer version;
> private String value;
> // Constructors
> /** default constructor */
> public Sample() {
> }
> /** full constructor */
> public Sample(String value) {
> this.value = value;
> }
>
>
> // Property accessors
> @Id @GeneratedValue
>
> @Column(name="id", unique=false, nullable=false, insertable=true, updatable=true)
> public Long getId() {
> return this.id;
> }
>
> public void setId(Long id) {
> this.id = id;
> }
>
> @Column(name="version", unique=false, nullable=false, insertable=true, updatable=true)
> public Integer getVersion() {
> return this.version;
> }
>
> public void setVersion(Integer version) {
> this.version = version;
> }
>
> @Column(name="value", unique=false, nullable=true, insertable=true, updatable=true)
> public String getValue() {
> return this.value;
> }
>
> public void setValue(String value) {
> this.value = value;
> }
> }
> -----
> There should be a @Version annotation on the version property!
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (HBX-688) hbm2java is not generating the @Version annotation for the <version ...> element
by Max Rydahl Andersen (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-688?page=co... ]
Max Rydahl Andersen commented on HBX-688:
-----------------------------------------
yes, extending/adding a junit test to validate gives extra karma points .
> hbm2java is not generating the @Version annotation for the <version ...> element
> --------------------------------------------------------------------------------
>
> Key: HBX-688
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-688
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.1.beta5
> Reporter: Sean Dawson
>
>
> See http://forum.hibernate.org/viewtopic.php?p=2310547#2310547
> Given a mapping file:
> ----
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated Jun 13, 2006 3:27:21 PM by Hibernate Tools 3.1.0.beta5 -->
> <hibernate-mapping>
> <class name="Sample" table="Sample">
> <id name="id" type="java.lang.Long">
> <column name="id" />
> <generator class="native" />
> </id>
> <version name="version" column="version"/>
> <property name="value" column="value" type="string"/>
> </class>
> </hibernate-mapping>
> ----
> the following ejb is generated (via hbm2java, ejb3="true", jdk5="true":
> ----
> // default package
> // Generated Jun 16, 2006 3:23:35 PM by Hibernate Tools 3.1.0.beta5
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.Id;
> import javax.persistence.Table;
> /**
> * Sample generated by hbm2java
> */
> @Entity
> @Table(name="Sample"
> )
> public class Sample implements java.io.Serializable {
> // Fields
> private Long id;
> private Integer version;
> private String value;
> // Constructors
> /** default constructor */
> public Sample() {
> }
> /** full constructor */
> public Sample(String value) {
> this.value = value;
> }
>
>
> // Property accessors
> @Id @GeneratedValue
>
> @Column(name="id", unique=false, nullable=false, insertable=true, updatable=true)
> public Long getId() {
> return this.id;
> }
>
> public void setId(Long id) {
> this.id = id;
> }
>
> @Column(name="version", unique=false, nullable=false, insertable=true, updatable=true)
> public Integer getVersion() {
> return this.version;
> }
>
> public void setVersion(Integer version) {
> this.version = version;
> }
>
> @Column(name="value", unique=false, nullable=true, insertable=true, updatable=true)
> public String getValue() {
> return this.value;
> }
>
> public void setValue(String value) {
> this.value = value;
> }
> }
> -----
> There should be a @Version annotation on the version property!
--
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
17 years, 10 months
[Hibernate-JIRA] Commented: (HBX-688) hbm2java is not generating the @Version annotation for the <version ...> element
by Stephen Longo (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-688?page=co... ]
Stephen Longo commented on HBX-688:
-----------------------------------
Hi,
I have a patch for this bug and I'd like to submit it for evaluation.
How may I proceed? Do I just attach the file as an attachment to this JIRA?
Kind regards,
Stephen Longo
> hbm2java is not generating the @Version annotation for the <version ...> element
> --------------------------------------------------------------------------------
>
> Key: HBX-688
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-688
> Project: Hibernate Tools
> Type: Bug
> Components: hbm2java
> Versions: 3.1.beta5
> Reporter: Sean Dawson
>
>
> See http://forum.hibernate.org/viewtopic.php?p=2310547#2310547
> Given a mapping file:
> ----
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <!-- Generated Jun 13, 2006 3:27:21 PM by Hibernate Tools 3.1.0.beta5 -->
> <hibernate-mapping>
> <class name="Sample" table="Sample">
> <id name="id" type="java.lang.Long">
> <column name="id" />
> <generator class="native" />
> </id>
> <version name="version" column="version"/>
> <property name="value" column="value" type="string"/>
> </class>
> </hibernate-mapping>
> ----
> the following ejb is generated (via hbm2java, ejb3="true", jdk5="true":
> ----
> // default package
> // Generated Jun 16, 2006 3:23:35 PM by Hibernate Tools 3.1.0.beta5
> import javax.persistence.Column;
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.Id;
> import javax.persistence.Table;
> /**
> * Sample generated by hbm2java
> */
> @Entity
> @Table(name="Sample"
> )
> public class Sample implements java.io.Serializable {
> // Fields
> private Long id;
> private Integer version;
> private String value;
> // Constructors
> /** default constructor */
> public Sample() {
> }
> /** full constructor */
> public Sample(String value) {
> this.value = value;
> }
>
>
> // Property accessors
> @Id @GeneratedValue
>
> @Column(name="id", unique=false, nullable=false, insertable=true, updatable=true)
> public Long getId() {
> return this.id;
> }
>
> public void setId(Long id) {
> this.id = id;
> }
>
> @Column(name="version", unique=false, nullable=false, insertable=true, updatable=true)
> public Integer getVersion() {
> return this.version;
> }
>
> public void setVersion(Integer version) {
> this.version = version;
> }
>
> @Column(name="value", unique=false, nullable=true, insertable=true, updatable=true)
> public String getValue() {
> return this.value;
> }
>
> public void setValue(String value) {
> this.value = value;
> }
> }
> -----
> There should be a @Version annotation on the version property!
--
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
17 years, 10 months
[Hibernate-JIRA] Created: (HBX-868) HibernateToolTask destdir not respected from chained ant
by Michael Kintzer (JIRA)
HibernateToolTask destdir not respected from chained ant
--------------------------------------------------------
Key: HBX-868
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-868
Project: Hibernate Tools
Type: Bug
Components: ant
Versions: 3.2beta9
Environment: Hibernate 3.2.1 HSQLDB 1.8.0-7.
Reporter: Michael Kintzer
Attachments: destdir_bug.zip
Per the Hibernate Tools documentation: The destdir attribute of the <hibernatetool> ant task is defined as:
destdir (required): destination directory for files generated with exporters.
Am using <hibernatetool> ant task to export ddl using hbm2ddl. This task is located in ./inner/build.xml. Relative snippet of build.xml:
<echo message="destdir attribute points to: ${data.dir}"/>
<hibernatetool destdir="${data.dir}">
<classpath path="${build}"/>
<configuration>
<fileset dir="${src}">
<include name="**/*.hbm.xml"/>
</fileset>
</configuration>
<hbm2ddl drop="false" create="true" export="true" update="false"/>
</hibernatetool>
Problem is that when ant build files are chained together, i.e. ./outer/build.xml calls ./inner/build.xml, the ddl output is written to a directory relative to ./outer, not ./inner as is specified by the "destdir" attribute in the ant task.
The evaluated value in ant for ${data.dir} when run in both cases is identical:
When run from ./inner/build.xml
[echo] destdir attribute points to: /home/michael/p4/private/mkintzer/hbtoolsbug/inner/data
When run from ./outer/build.xml
[echo] destdir attribute points to: /home/michael/p4/private/mkintzer/hbtoolsbug/inner/data
So according to the echo statements, ant in both cases has evaluated destdir to be the same absolute path, yet the output ends up in two different locations depending on where the build was run from.
--
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
17 years, 10 months
[Hibernate-JIRA] Created: (HHH-2406) Improve the collection of the parameter meta data.
by Bryan Brouckaert (JIRA)
Improve the collection of the parameter meta data.
--------------------------------------------------
Key: HHH-2406
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2406
Project: Hibernate3
Type: Improvement
Components: query-hql
Versions: 3.2.2
Environment: WindowsXP + JBoss 3.2.6 + Spring
Reporter: Bryan Brouckaert
Currently the meta data of a parameter is collected with the first occurence of the parameter and is never updated afterward, this gives some strange effects in certain cases.
If you have the following classes:
<class name="Contract">
<id name="id">
<generator class="native"/>
</id>
<many-to-one name="type" property-ref="key" >
<column name="type" length="64"/>
</many-to-one>
</class>
<class name="AgreementType">
<id name="id">
<generator class="native" />
</id>
<property name="key" unique="true" length="64"/>
<property name="value" />
</class>
Then the following HQL will fail:
select c from Contract c where ( :type is null or c.type = :type )
I found out that is it is because the "id" of the type is provided as JDBC parameter and not the value.
The following fixes the problem:
select c from Contract c where ( c.type = :type or :type is null )
See the different order of the conditions? This time the "value" of the type is provided as JDBC parameter (and everything works). The reason is simple, since in the first HQL the first instance of the parameter is not applied on the c.type property the "property-key" information is not taken into account.
I think that hibernate should be able to execute both statements. It seems to me that when a parameter is encounterd a second time Hibernate should add the extra meta data.
--
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
17 years, 10 months