You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(32) |
Jun
(175) |
Jul
(209) |
Aug
(302) |
Sep
(287) |
Oct
(339) |
Nov
(314) |
Dec
(329) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(479) |
Feb
(389) |
Mar
(599) |
Apr
(307) |
May
(390) |
Jun
(300) |
Jul
(410) |
Aug
(458) |
Sep
(299) |
Oct
(315) |
Nov
(363) |
Dec
(529) |
2005 |
Jan
(568) |
Feb
(434) |
Mar
(1004) |
Apr
(823) |
May
(767) |
Jun
(763) |
Jul
(854) |
Aug
(862) |
Sep
(560) |
Oct
(853) |
Nov
(763) |
Dec
(731) |
2006 |
Jan
(776) |
Feb
(608) |
Mar
(657) |
Apr
(424) |
May
(559) |
Jun
(440) |
Jul
(448) |
Aug
(58) |
Sep
|
Oct
(17) |
Nov
(16) |
Dec
(8) |
2007 |
Jan
(1) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
(3) |
Jun
(3) |
Jul
(3) |
Aug
(16) |
Sep
(10) |
Oct
(4) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(8) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <leg...@at...> - 2003-12-02 22:32:41
|
Message: The following issue has been closed. Resolver: Max Rydahl Andersen Date: Tue, 2 Dec 2003 4:32 PM Now available from CVS --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?= key=3DHB-304 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-304 Summary: Velocity renderer Type: Improvement Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components:=20 toolset Fix Fors: 2.1 Assignee: Max Rydahl Andersen Reporter: Didier Girard Created: Tue, 2 Sep 2003 7:06 AM Updated: Tue, 2 Dec 2003 4:32 PM Description: Here is the code of my basic Velocity renderer : import java.io.PrintWriter; import java.io.StringWriter; import java.util.Iterator; import java.util.Map; import java.util.Properties; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.Velocity; import net.sf.hibernate.tool.hbm2java.AbstractRenderer; import net.sf.hibernate.tool.hbm2java.ClassMapping; import net.sf.hibernate.tool.hbm2java.Field; abstract public class AbstractHBM2JavaVelocityRenderer extends AbstractRend= erer { public void render(String savedToPackage, String savedToClass, ClassMap= ping classMapping, Map class2classmap, PrintWriter mainwriter) throws Excep= tion { StringWriter strWriter =3D null; String template =3D getTemplate(); strWriter =3D mergeTemplate(template, savedToPackage, savedToClass,= classMapping, class2classmap); mainwriter.print(strWriter.toString()); } private Field findIdentifier(ClassMapping classMapping) { Field result =3D null; for (Iterator fields =3D classMapping.getFields().iterator(); field= s.hasNext();) { Field field =3D (Field) fields.next(); if (field.isGeneratedAsProperty() && field.isIdentifier() && (r= esult =3D=3D null)) { result =3D field; } } return result; } public StringWriter mergeTemplate(String template, String savedToPackag= e, String savedToClass, ClassMapping classMapping, Map class2classmap) thro= ws Exception { Properties p =3D new Properties(); p.setProperty("resource.loader", "class"); p.setProperty("class.resource.loader.description", "Velocity Classp= ath Resource Loader"); p.setProperty("class.resource.loader.class", "org.apache.velocity.r= untime.resource.loader.ClasspathResourceLoader"); Velocity.init(p); VelocityContext context =3D new VelocityContext(); context.put("savedToPackage", savedToPackage); context.put("savedToClass", savedToClass); context.put("classMapping", classMapping); context.put("class2classmap", class2classmap); Field idEntity =3D findIdentifier(classMapping); context.put("idEntity", idEntity); StringWriter strWriter =3D new StringWriter(); Velocity.mergeTemplate(template, "ISO-8859-1", context, strWriter); return strWriter; } =20 public abstract String getTemplate(); } Here is a example of template : package ${classMapping.getGeneratedPackageName()}; #set($entity =3D "${classMapping.Name}" ) #set($entityLowerCase =3D "${classMapping.Name.toLowerCase()}" ) /** API du service Entreprise g=C3=A9n=C3=A9r=C3=A9 pour l'entit=C3=A9 $sav= edToClass. * @author hibernateGenerator **/ public interface $savedToClass extends Service { =09public $entity find${entity}(${idEntity.ClassType.getFullyQualifiedName(= )} in_${entityLowerCase}Id) throws ServiceException; =09public void delete${entity}(${entity} in_${entityLowerCase}) throws Serv= iceException; =09public $entity add${entity}(${entity} in_${entityLowerCase}) throws Serv= iceException; =09public $entity update${entity}(${entity} in_${entityLowerCase}) throws S= erviceException; } =09 --------------------------------------------------------------------- JIRA INFORMATION: 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= .jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 22:26:41
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Tue, 2 Dec 2003 4:26 PM Body: This should now be quite possible with the refactoring of hbm2java. Each "element" (properties, classes etc.) now have access to the hbm.xml's xml data - thus giving access to all the relavant info for XDoclet tags.... contributions welcome ;) --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-63 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-63 Summary: XDoclet tags in generated Java files Type: New Feature Status: Open Priority: Critical Project: Hibernate2 Components: toolset Versions: 2.1 Assignee: Max Rydahl Andersen Reporter: Gavin King Created: Tue, 6 May 2003 10:53 PM Updated: Tue, 2 Dec 2003 4:26 PM Description: For round-tripping to work, we need the Java code generated by CodeGenerator to include XDoclet tags. This is a bit of work, but very well worth the effort. Max, are you interested in taking this on? --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 21:04:41
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Tue, 2 Dec 2003 3:02 PM Body: ...but i also guess that this should be extended to include <joined-subclass> ? --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-515 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-515 Summary: Allow a different persister for a Subclass Type: Patch Status: Open Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 Assignee: Gavin King Reporter: Nick Johnson Created: Tue, 2 Dec 2003 2:47 PM Updated: Tue, 2 Dec 2003 3:02 PM Environment: Hibernate from CVS, using the same branch we used for our custom collection persister patch (see HB-419) Description: In some cases it is desirable to persist a subclass differently than a class; for example, if the subclass is persisting a different number of fields or if the fields are in a different order for some reason. This patch allows a different persister to be bound to a Subclass. If one is not defined, the parent class's persister is used (as was the case before). --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 21:02:41
|
Message: The following issue has been re-assigned. Assignee: Gavin King (mailto:ga...@hi...) Assigner: Max Rydahl Andersen (mailto:xa...@xa...) Date: Tue, 2 Dec 2003 3:01 PM Comment: Interesting, and a nice and simple patch ;) ...but i'll let Gavin have a saying before applying the patch. So, Gavin - can you see any problems with this ? The arguments sounds valid enough when we talk about custom persisters. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-515 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-515 Summary: Allow a different persister for a Subclass Type: Patch Status: Open Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 Assignee: Gavin King Reporter: Nick Johnson Created: Tue, 2 Dec 2003 2:47 PM Updated: Tue, 2 Dec 2003 3:01 PM Environment: Hibernate from CVS, using the same branch we used for our custom collection persister patch (see HB-419) Description: In some cases it is desirable to persist a subclass differently than a class; for example, if the subclass is persisting a different number of fields or if the fields are in a different order for some reason. This patch allows a different persister to be bound to a Subclass. If one is not defined, the parent class's persister is used (as was the case before). --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 20:50:41
|
The following issue has been updated: Updater: Nick Johnson (mailto:njo...@ci...) Date: Tue, 2 Dec 2003 2:49 PM Comment: Patches Binder, Subclass and the DTD. Changes: Attachment changed to hibernate subclass patch --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-515&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-515 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-515 Summary: Allow a different persister for a Subclass Type: Patch Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 Assignee: Reporter: Nick Johnson Created: Tue, 2 Dec 2003 2:47 PM Updated: Tue, 2 Dec 2003 2:49 PM Environment: Hibernate from CVS, using the same branch we used for our custom collection persister patch (see HB-419) Description: In some cases it is desirable to persist a subclass differently than a class; for example, if the subclass is persisting a different number of fields or if the fields are in a different order for some reason. This patch allows a different persister to be bound to a Subclass. If one is not defined, the parent class's persister is used (as was the case before). --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 20:48:41
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-515 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-515 Summary: Allow a different persister for a Subclass Type: Patch Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 Assignee: Reporter: Nick Johnson Created: Tue, 2 Dec 2003 2:47 PM Updated: Tue, 2 Dec 2003 2:47 PM Environment: Hibernate from CVS, using the same branch we used for our custom collection persister patch (see HB-419) Description: In some cases it is desirable to persist a subclass differently than a class; for example, if the subclass is persisting a different number of fields or if the fields are in a different order for some reason. This patch allows a different persister to be bound to a Subclass. If one is not defined, the parent class's persister is used (as was the case before). --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 17:09:14
|
The following issue has been updated: Updater: Matt Read (mailto:mr...@sp...) Date: Mon, 1 Dec 2003 4:19 PM Changes: Attachment changed to EntityATest.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:19 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 17:06:59
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-514 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-514 Summary: SybaseAnywhereDialect should return " for open and close quote Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: John Urberg Created: Tue, 2 Dec 2003 11:06 AM Updated: Tue, 2 Dec 2003 11:06 AM Environment: Sybase ASA 7.0.4, Windows 2000, Sybase JConnect 5.5 JDBC driver, Hibernate 2.1 beta 4 Description: The SybaseAnywhereDialect uses the default sybase quote characters of [ and ]. The Sybase ASA database requires " as the quote characters. This can be changed by adding the following two methods to SybaseAnywhereDialect: public char closeQuote() { return '"'; } public char openQuote() { return '"'; } --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 12:20:37
|
The following issue has been updated: Updater: Matt Read (mailto:mr...@sp...) Date: Mon, 1 Dec 2003 4:18 PM Changes: Attachment changed to EntityA.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:18 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 10:29:41
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 2 Dec 2003 4:28 AM oops, as per the HQL documentation, a path expression may not end in a composite value. So use count(*) or count(component.property). Makes sense, if you think about it: nullability of a composite value is slightly ambiguous. I realise that I told you the wrong thing (didn't look closely at the select clause). My Bad. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Closed Priority: Minor Resolution: REJECTED Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Tue, 2 Dec 2003 4:28 AM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 09:54:42
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 2 Dec 2003 3:52 AM Body: I mean I did half a fix the first time. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-510 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-510 Summary: Wrong alias with a class with $s in its name Type: Bug Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Alfonso da Silva Created: Mon, 1 Dec 2003 4:43 AM Updated: Tue, 2 Dec 2003 3:52 AM Description: I have been verifying version 2.1 rc1 and the bug HB-499 (http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-499) continues happening. I have modified line 36 of the net.sf.hibernate.sql.Alias class: String unquoted = getUnquotedAliasString(sqlIdentifier,quoteType) .replace('$','_'); Bye. Alfonso da Silva. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 09:52:41
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 2 Dec 2003 3:52 AM OK, I did half a fix. Note that changing Alias as you suggest will break other stuff. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-510 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-510 Summary: Wrong alias with a class with $s in its name Type: Bug Status: Closed Priority: Minor Resolution: FIXED Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Alfonso da Silva Created: Mon, 1 Dec 2003 4:43 AM Updated: Tue, 2 Dec 2003 3:52 AM Description: I have been verifying version 2.1 rc1 and the bug HB-499 (http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-499) continues happening. I have modified line 36 of the net.sf.hibernate.sql.Alias class: String unquoted = getUnquotedAliasString(sqlIdentifier,quoteType) .replace('$','_'); Bye. Alfonso da Silva. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 09:12:41
|
The following comment has been added to this issue: Author: Gavin King Created: Tue, 2 Dec 2003 3:11 AM Body: Yeah ok, I understand this (and what I have to do to fix it). I'll fix it for 2.1.1, not for 2.1 final. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-511 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-511 Summary: ClassCastException while caching queries with "select new..." Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.1 beta 6 Assignee: Reporter: Daniel Rosenbaum Created: Mon, 1 Dec 2003 1:37 PM Updated: Tue, 2 Dec 2003 3:11 AM Environment: 2.1 beta 6 Description: I have code similar to the example from section 9.4 in the docs: Query query = HibernateSession.currentSession().createQuery( "select new Family(mother, mate, offspr) " + "from eg.DomesticCat as mother " + " join mother.mate as mate " + " left join mother.kittens as offspr"); query.setCacheable(true); query.setCacheRegion("FamilyQueryCache"); return query.list(); When this runs though I get the following exception: java.lang.ClassCastException: Family at net.sf.hibernate.cache.QueryCache.put(QueryCache.java:53) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:967) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45) seems that the code is trying to cast the Family object into an Object[]. The code works if I turn caching off. But if I try to cache a query that uses "select new ..." it generates this exception. Best regards, Daniel Rosenbaum --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 09:10:42
|
Message: The following issue has been closed. Resolver: Gavin King Date: Tue, 2 Dec 2003 3:10 AM Thanks. I've fixed this. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-512 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-512 Summary: 2.1 RC1 not behaving with some Middlegen generated xml files Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: toolset Fix Fors: 2.1 final Versions: 2.1 rc1 Assignee: Reporter: Daniel Rosenbaum Created: Mon, 1 Dec 2003 4:05 PM Updated: Tue, 2 Dec 2003 3:10 AM Description: When having a table with more than one PK, middlegen generates an xml file with elements similar to this (as well as generating a QwDataGrpVwPK class): <composite-id name="comp_id" class="testQwb.hibernate.persistent.QwDataGrpVwPK"> <meta attribute="field-description"> @hibernate.id generator-class="assigned" </meta> <!-- bi-directional many-to-one association to QwDataGrp --> <key-many-to-one name="qwDataGrp" class="testQwb.hibernate.persistent.QwDataGrp" > <column name="DATA_GRP_NUM" /> </key-many-to-one> <!-- uni-directional many-to-one association to QwVw --> <key-many-to-one name="qwVw" class="testQwb.hibernate.persistent.QwVw" > <column name="VW_NUM" /> </key-many-to-one> </composite-id> The problem is that Hibernate is choking when it sees the <meta> attribute here. If I comment out the <meta> portion then it works ok. In previous versions this also worked fine. Something about the presence of the meta tag over here messes up the parsing. The exception I get is: 16:58:13,505 ERROR Configuration:276 - Could not configure datastore from input stream java.lang.NullPointerException at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239) at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:263) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:826) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:812) at org.ifmc.qw.hibernate.HibernateSession.init(HibernateSession.java:44) Best Regards, Daniel Rosenbaum --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 04:16:23
|
The following issue has been updated: Updater: Matt Read (mailto:mr...@sp...) Date: Mon, 1 Dec 2003 4:21 PM Changes: Attachment changed to EntityA.hbm.xml --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:21 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 04:14:15
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:14 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 04:14:02
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-512 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-512 Summary: 2.1 RC1 not behaving with some Middlegen generated xml files Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Components: toolset Versions: 2.1 rc1 Assignee: Reporter: Daniel Rosenbaum Created: Mon, 1 Dec 2003 4:05 PM Updated: Mon, 1 Dec 2003 4:05 PM Description: When having a table with more than one PK, middlegen generates an xml file with elements similar to this (as well as generating a QwDataGrpVwPK class): <composite-id name="comp_id" class="testQwb.hibernate.persistent.QwDataGrpVwPK"> <meta attribute="field-description"> @hibernate.id generator-class="assigned" </meta> <!-- bi-directional many-to-one association to QwDataGrp --> <key-many-to-one name="qwDataGrp" class="testQwb.hibernate.persistent.QwDataGrp" > <column name="DATA_GRP_NUM" /> </key-many-to-one> <!-- uni-directional many-to-one association to QwVw --> <key-many-to-one name="qwVw" class="testQwb.hibernate.persistent.QwVw" > <column name="VW_NUM" /> </key-many-to-one> </composite-id> The problem is that Hibernate is choking when it sees the <meta> attribute here. If I comment out the <meta> portion then it works ok. In previous versions this also worked fine. Something about the presence of the meta tag over here messes up the parsing. The exception I get is: 16:58:13,505 ERROR Configuration:276 - Could not configure datastore from input stream java.lang.NullPointerException at net.sf.hibernate.util.StringHelper.qualify(StringHelper.java:239) at net.sf.hibernate.cfg.Binder.bindComponent(Binder.java:734) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:263) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268) at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935) at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:826) at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:812) at org.ifmc.qw.hibernate.HibernateSession.init(HibernateSession.java:44) Best Regards, Daniel Rosenbaum --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 03:56:35
|
The following issue has been updated: Updater: Matt Read (mailto:mr...@sp...) Date: Mon, 1 Dec 2003 4:19 PM Changes: Attachment changed to AssociationForA.java --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:19 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-02 03:56:35
|
The following issue has been updated: Updater: Matt Read (mailto:mr...@sp...) Date: Mon, 1 Dec 2003 4:19 PM Changes: Attachment changed to output.stack.txt --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-513 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-513 Summary: QueryException using composite elements Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Matt Read Created: Mon, 1 Dec 2003 4:14 PM Updated: Mon, 1 Dec 2003 4:19 PM Environment: Hibernate 2.1rc1 Sun JDK 1.4.2_01 on Windows XP Description: See also: http://forum.hibernate.org/viewtopic.php?t=924854 I've tried to make this as simple as possible but I can't find any guidelines on exactly what that means. I've included everything I think is needed to recreate the problem but I can probably make up a standalone jar if absolutely necessary. Let me know if this would be useful. Here's 2 Java classes with XDoclet markup, EntityA is a standard entity and AssocationForA is a component used in the many-to-many assocation from Entity to itself. /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.HashSet; import java.util.Set; /** * @hibernate.class table="EntityA" * proxy = "gatt.example.EntityA" * */ public class EntityA { long id; protected Set association = new HashSet(); /** * @return * * @hibernate.id column="id" * generator-class="increment" * unsaved-value="0" * */ public long getId() { return id; } public void setId(long id) { this.id = id; } /** * * @hibernate.set cascade="all" * lazy="true" * table="Association_To_Self" * @hibernate.collection-key column="entityA_id" * @hibernate.collection-composite-element class="gatt.example.AssociationForA" * * @return */ public Set getAssociation() { return association; } /** * * @param associationForA */ public void setAssociation(Set associationForA) { this.association = associationForA; } } /* * Created on 17-Nov-2003 * */ package gatt.example; import java.util.Date; /** * @hibernate.component * * @author Gatt * */ public class AssociationForA { protected Date date; protected EntityA reverseAssociation; /** * @hibernate.property * * @return Returns the date. */ public Date getDate() { return date; } /** * @param date The date to set. */ public void setDate(Date date) { this.date = date; } /** * @hibernate.many-to-one column="association_id" * not-null="true" * cascade="save-update" * * @return Returns the associated instance. */ public EntityA getReverseAssociation() { return reverseAssociation; } /** * @param attackedBy The attackedBy to set. */ public void setReverseAssociation(EntityA reverseAssociation) { this.reverseAssociation = reverseAssociation; } } Here is the generated mapping file: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> <hibernate-mapping> <class name="gatt.example.EntityA" table="EntityA" proxy="gatt.example.EntityA" dynamic-update="false" dynamic-insert="false" > <id name="id" column="id" type="long" unsaved-value="0" > <generator class="increment"> </generator> </id> <set name="association" table="Association_To_Self" lazy="true" inverse="false" cascade="all" sort="unsorted" > <key column="entityA_id" /> <composite-element class="gatt.example.AssociationForA" > <property name="date" type="java.util.Date" update="true" insert="true" column="date" /> <many-to-one name="reverseAssociation" class="gatt.example.EntityA" cascade="save-update" outer-join="auto" update="true" insert="true" column="association_id" not-null="true" /> </composite-element> </set> <!-- To add non XDoclet property mappings, create a file named hibernate-properties-EntityA.xml containing the additional properties and place it in your merge dir. --> </class> </hibernate-mapping> And here is the test class: /* * Created on Dec 1, 2003 * */ package gatt.example; import gatt.util.hibernate.HibernateFilter; import junit.framework.TestCase; import net.sf.hibernate.Query; import net.sf.hibernate.Session; import net.sf.hibernate.SessionFactory; /** * @author Gatt * */ public class EntityATest extends TestCase { public static void main(String[] args) { junit.textui.TestRunner.run(EntityATest.class); } protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } /** * Constructor for EntityATest. * * @param arg0 */ public EntityATest(String arg0) { super(arg0); } public void testQuery() { try { SessionFactory sf = HibernateFilter.getSessionFactory(); Session session = sf.openSession(); // get the number of associations Query query = session.createQuery("select count(assoc) from EntityA entityA " + "join entityA.association assoc"); int count = ((Integer) query.iterate().next()).intValue(); } catch (Exception e) { e.printStackTrace(); } } } And finally the error: net.sf.hibernate.QueryException: could not resolve property: id of: gatt.example.AssociationForA [select count(assoc) from gatt.example.EntityA entityA join entityA.association assoc] at net.sf.hibernate.persister.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:38) at net.sf.hibernate.collection.AbstractCollectionPersister.toType(AbstractCollectionPersister.java:678) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:244) at net.sf.hibernate.hql.PathExpressionParser.end(PathExpressionParser.java:283) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.SelectParser.token(SelectParser.java:140) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.ClauseParser.end(ClauseParser.java:114) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:143) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:152) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:141) at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:287) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1488) at net.sf.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1518) at net.sf.hibernate.impl.QueryImpl.iterate(QueryImpl.java:33) at gatt.example.EntityATest.testQuery(EntityATest.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:395) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:279) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:171) --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-01 19:37:46
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-511 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-511 Summary: ClassCastException while caching queries with "select new..." Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Versions: 2.1 beta 6 Assignee: Reporter: Daniel Rosenbaum Created: Mon, 1 Dec 2003 1:37 PM Updated: Mon, 1 Dec 2003 1:37 PM Environment: 2.1 beta 6 Description: I have code similar to the example from section 9.4 in the docs: Query query = HibernateSession.currentSession().createQuery( "select new Family(mother, mate, offspr) " + "from eg.DomesticCat as mother " + " join mother.mate as mate " + " left join mother.kittens as offspr"); query.setCacheable(true); query.setCacheRegion("FamilyQueryCache"); return query.list(); When this runs though I get the following exception: java.lang.ClassCastException: Family at net.sf.hibernate.cache.QueryCache.put(QueryCache.java:53) at net.sf.hibernate.hql.QueryTranslator.find(QueryTranslator.java:967) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:45) seems that the code is trying to cast the Family object into an Object[]. The code works if I turn caching off. But if I try to cache a query that uses "select new ..." it generates this exception. Best regards, Daniel Rosenbaum --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-01 10:43:41
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-510 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-510 Summary: Wrong alias with a class with $s in its name Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Alfonso da Silva Created: Mon, 1 Dec 2003 4:43 AM Updated: Mon, 1 Dec 2003 4:43 AM Description: I have been verifying version 2.1 rc1 and the bug HB-499 (http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-499) continues happening. I have modified line 36 of the net.sf.hibernate.sql.Alias class: String unquoted = getUnquotedAliasString(sqlIdentifier,quoteType) .replace('$','_'); Bye. Alfonso da Silva. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-01 10:28:43
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-509 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-509 Summary: Possibility to specify additional properties for JMX MBean Type: New Feature Status: Unassigned Priority: Major Project: Hibernate2 Components: core Versions: 2.1 rc1 Assignee: Reporter: Michael Gloegl Created: Mon, 1 Dec 2003 4:28 AM Updated: Mon, 1 Dec 2003 4:28 AM Description: There should be a possibility to specify additional properties like the hibernate cache provider or the "use outer join" option in the jboss-service.xml when using the MBean Adapter. This is especially important as the inability to set the cache provider creates a dependency with ehcache.jar (through net.sf.ehcache.hibernate.Provider) even when not using any caching. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-12-01 05:06:42
|
The following comment has been added to this issue: Author: Alexey Kaigorodov Created: Sun, 30 Nov 2003 11:06 PM Body: In Hibernate 2.1rc1 exception does not appear. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-440 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-440 Summary: Direct collection property access Type: Bug Status: Closed Priority: Major Resolution: CANNOT REPRODUCE Project: Hibernate2 Components: core Fix Fors: 2.1 rc1 Versions: 2.1 beta 5 Assignee: Max Rydahl Andersen Reporter: Alexey Kaigorodov Created: Fri, 31 Oct 2003 3:26 AM Updated: Sun, 30 Nov 2003 11:06 PM Description: <bag name="..." access="field"> ... </bag> causes exception unless exists getter net.sf.hibernate.MappingException: Problem trying to set property type by reflection at net.sf.hibernate.mapping.Value.setTypeByReflection(Value.java:103) at net.sf.hibernate.cfg.Binder.createProperty(Binder.java:953) at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:946) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:313) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1143) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:243) at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:266) at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:349) at net.sf.hibernate.cfg.Configuration.addJar(Configuration.java:320) ... Caused by: net.sf.hibernate.PropertyNotFoundException: Could not find a getter for ... in class ... -- With best regards, Alexey --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-30 03:59:42
|
The following comment has been added to this issue: Author: Gavin King Created: Sat, 29 Nov 2003 9:57 PM Body: Since 2.1 DTD just adds some new attributes and elements, I don't see any reason to not just overwrite the existing 2.0 DTDs. We have always done this in the past for backward-compatible DTD changes. We wan't to make the upgrade path to 2.1 as smooth as possible for everyone (2.1 should be a binary-compatible drop in upgrade for most people). --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-508 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-508 Summary: DTD update to 2.1 Type: Improvement Status: Open Priority: Major Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Gavin King Reporter: Christian Bauer Created: Sat, 29 Nov 2003 3:41 PM Updated: Sat, 29 Nov 2003 9:57 PM Description: All DTDs in the Hibernate source and on hibernate.sourgeforge.net have to be updated for 2.1. This means either to just rename the DTD or to actually copy a new version to the website. In the source: ./src/net/sf/hibernate/hibernate-configuration-2.0.dtd ./src/net/sf/hibernate/hibernate-mapping-2.0.dtd On the website: hibernate-mapping-1.1.dtd hibernate-mapping-2.0.dtd hibernate-configuration-2.0.dtd hibernate-mapping.dtd hibernate-configuration.dtd I suggest we leave the "untagged" files as they are (the ones without version number) and just add the 2.1 versions. All version numbers have to be replaced in the source files (the unit tests) and documentation. According to our roadmap, 2.1 is the stable release for the next 6 to 12 months, but we have a significant installation base for 2.0. We can't continue mixing them and have to update now. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
From: <leg...@at...> - 2003-11-29 21:42:42
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-508 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-508 Summary: DTD update to 2.1 Type: Improvement Status: Open Priority: Major Project: Hibernate2 Components: core Versions: 2.1 final Assignee: Gavin King Reporter: Christian Bauer Created: Sat, 29 Nov 2003 3:41 PM Updated: Sat, 29 Nov 2003 3:41 PM Description: All DTDs in the Hibernate source and on hibernate.sourgeforge.net have to be updated for 2.1. This means either to just rename the DTD or to actually copy a new version to the website. In the source: ./src/net/sf/hibernate/hibernate-configuration-2.0.dtd ./src/net/sf/hibernate/hibernate-mapping-2.0.dtd On the website: hibernate-mapping-1.1.dtd hibernate-mapping-2.0.dtd hibernate-configuration-2.0.dtd hibernate-mapping.dtd hibernate-configuration.dtd I suggest we leave the "untagged" files as they are (the ones without version number) and just add the 2.1 versions. All version numbers have to be replaced in the source files (the unit tests) and documentation. According to our roadmap, 2.1 is the stable release for the next 6 to 12 months, but we have a significant installation base for 2.0. We can't continue mixing them and have to update now. --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |