[Hibernate-JIRA] Created: (HHH-2048) Incomplete MappingException at org.hibernate.mapping.SimpleValue
by Diego Pires Plentz (JIRA)
Incomplete MappingException at org.hibernate.mapping.SimpleValue
----------------------------------------------------------------
Key: HHH-2048
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2048
Project: Hibernate3
Type: Improvement
Versions: 3.2.0.cr4
Reporter: Diego Pires Plentz
When a mapped class has a wrong type, an exception is throwed, but it doesnt say nothing about what class/table is mapped wrongly.
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
Can become something like this...
public Type getType() throws MappingException {
if (typeName==null) {
throw new MappingException("No type name");
}
Type result = TypeFactory.heuristicType(typeName, typeParameters);
if (result==null) {
String msg = "Could not determine type for: " + typeName;
if(table != null){
msg += ", at table: " + table.getName();
}
if(columns!=null && columns.size()>0) {
msg += ", for columns: " + columns;
}
throw new MappingException(msg);
}
return result;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years
[Hibernate-JIRA] Created: (HBX-733) Updated DAO code generation as discussed over the email
by Alex Kalinovsky (JIRA)
Updated DAO code generation as discussed over the email
-------------------------------------------------------
Key: HBX-733
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-733
Project: Hibernate Tools
Type: Patch
Components: hbm2java, ant
Versions: 3.1alpha5
Environment: I have tested the patch on the latest version of Hibernate Tools I got from SVN 2 weeks ago.
Reporter: Alex Kalinovsky
Attachments: dao_generation.patch
This should be a complete implementation of DAO generation according to the design we have discussed over the email. I've tested this on our project so the DAOs should be good to go, but of course a more diverse testing would be needed before releasing it to public. I'm open for recommendations and suggestions, so I see this as the first draft. Below is a list of files and comments. Contact me at kalinovsky(a)yahoo.com.
src/java/org/hibernate/tool/hbm2x
DAONewExporter.java This class is coded mainly to accept additional parameters such as dao package name and provide flexible
file naming that is used by Ant task. It would not be needed if I integrate my changes into GenericExporter.
src/templates/dao
crudDao.ftl template for regeneratable CRUD interface
crudDaoImpl.ftl template for regeneratable CRUD DAO implementation
dao.ftl template for customizable DAO interface that extends CRUD interface
daoImpl.ftl template for customizable DAO implementation that extends CRUD implementation
src/templates/dao/base
dao.ftl base interface for all DAOs
queryDao.ftl base interface for all read-only entities
crudDao.ftl base interface for all editable entities
src/templates/dao/base/hibernate
abstractDao.ftl base implementation of DAO using Hibernate
abstractQueryDao.ftl base implementation of DAO for read-only entities using Hibernate
abstractCrudDao.ftl base implementation of DAO for editable entities using Hibernate
src/testsupport
codegen.properties Test configuration to see DAO generation in action
codegen-build.xml Test build file that generates DAOs for Author and Article and compiles generated code
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years
[Hibernate-JIRA] Created: (HHH-2016) Oracle9Dialect registers last_day() function as "lastday"
by Carl Lindberg (JIRA)
Oracle9Dialect registers last_day() function as "lastday"
---------------------------------------------------------
Key: HHH-2016
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2016
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.0 alpha, 3.0 beta 1, 3.0 beta 2, 3.0 beta 3, 3.0 beta 4, 3.0 rc 1, 3.0 final, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.1 beta 1, 3.1 beta 2, 3.1 rc 1, 3.1 rc2, 3.1 rc3, 3.1, 3.1.1, 3.1.2, 3.2.0.alpha1, 3.2.0.alpha2, 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3
Environment: Hibernate 2.x, 3.x with an Oracle database
Reporter: Carl Lindberg
Priority: Minor
Attachments: Oracle9DialectPatch.diff, Oracle9DialectPatchOption2.diff
Oracle9Dialect.java registers a "lastday" function, however the actual Oracle function is last_day() (with the underscore). This results in a SQL error if the function is used in HQL (and obviously, HQL will not accept use of "last_day").
The patch is basically:
- registerFunction( "lastday", new StandardSQLFunction("lastday", Hibernate.DATE) );
+ registerFunction( "last_day", new StandardSQLFunction("last_day", Hibernate.DATE) );
or, if support for the incorrect "lastday" usage should still be supported:
- registerFunction( "lastday", new StandardSQLFunction("lastday", Hibernate.DATE) );
+ registerFunction( "last_day", new StandardSQLFunction("last_day", Hibernate.DATE) );
+ registerFunction( "lastday", new StandardSQLFunction("last_day", Hibernate.DATE) );
Both patch options are attached.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (HBX-755) incorrect genreated code for many-to-many relationship
by azamjalali (JIRA)
incorrect genreated code for many-to-many relationship
-------------------------------------------------------
Key: HBX-755
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-755
Project: Hibernate Tools
Type: Bug
Components: ant
Versions: 3.2beta7
Reporter: azamjalali
The following code is generated for Table rolea and roleb( these tables have many-to-many relation). Both of entities use ManytoMany annotation without jointable annotation.
/////////////////////////////////////////////////////////////////////
package trce.impr.subsystem.entity;
// Generated Sep 17, 2006 1:04:06 AM by Hibernate Tools 3.2.0.beta7
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
/**
* RoleB generated by hbm2java
*/
@Entity
@Table(name="roleb"
,catalog="registration"
, uniqueConstraints = { }
)
public class RoleB implements java.io.Serializable {
// Fields
private int rolebId;
private Set<RoleA> roleas = new HashSet<RoleA>(0);
// Constructors
/** default constructor */
public RoleB() {
}
/** minimal constructor */
public RoleB(int rolebId) {
this.rolebId = rolebId;
}
/** full constructor */
public RoleB(int rolebId, Set<RoleA> roleas) {
this.rolebId = rolebId;
this.roleas = roleas;
}
// Property accessors
@Id
@Column(name="roleb_id", unique=true, nullable=false, insertable=true, updatable=true)
public int getRolebId() {
return this.rolebId;
}
public void setRolebId(int rolebId) {
this.rolebId = rolebId;
}
@ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="rolebs")
public Set<RoleA> getRoleas() {
return this.roleas;
}
public void setRoleas(Set<RoleA> roleas) {
this.roleas = roleas;
}
}
////////////////////////////////////////////////////////////////////////////////////
package trce.impr.subsystem.entity;
// Generated Sep 17, 2006 1:04:06 AM by Hibernate Tools 3.2.0.beta7
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
/**
* RoleA generated by hbm2java
*/
@Entity
@Table(name="rolea"
,catalog="registration"
, uniqueConstraints = { }
)
public class RoleA implements java.io.Serializable {
// Fields
private int roleaId;
private Set<RoleB> rolebs = new HashSet<RoleB>(0);
// Constructors
/** default constructor */
public RoleA() {
}
/** minimal constructor */
public RoleA(int roleaId) {
this.roleaId = roleaId;
}
/** full constructor */
public RoleA(int roleaId, Set<RoleB> rolebs) {
this.roleaId = roleaId;
this.rolebs = rolebs;
}
// Property accessors
@Id
@Column(name="rolea_id", unique=true, nullable=false, insertable=true, updatable=true)
public int getRoleaId() {
return this.roleaId;
}
y
public void setRoleaId(int roleaId) {
this.roleaId = roleaId;
}
@ManyToMany(cascade={CascadeType.ALL}, fetch=FetchType.LAZY, mappedBy="roleas")
public Set<RoleB> getRolebs() {
return this.rolebs;
}
public void setRolebs(Set<RoleB> rolebs) {
this.rolebs = rolebs;
}
}
//////////////////////////////////////////////////////////////////////
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (ANN-438) Merging annotations and XML sometimes causes an XML parser error
by James Telfer (JIRA)
Merging annotations and XML sometimes causes an XML parser error
----------------------------------------------------------------
Key: ANN-438
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-438
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.0.cr1
Environment: Hibernate 3.2 CR2, SQL Server 2005
Reporter: James Telfer
I created a class and annotated it with EJB 3 annotations, then created an XML descriptor to store my named queries. The XML I used is excerpted below. I then added the mapping file to my cfg.xml as a <mapping resource=""/%gt; element. When Hibernate was configured, it threw the parser exception included below also.
The same error occurred when configuring my application within Tomcat (via Spring). To narrow down the problemI created a very simple class to configure Hibernate and ran that in Eclipse. This worked. The line used to configure Hibernate was: <code>new AnnotationConfiguration().configure(new File("hibernate.cfg.xml")).buildSessionFactory();</code>.
Eclipse is running on Windows using the JDK 1.5.07 Server VM with parallel GC and the Eclipse runner used the JDK server VM with standard GC. Tomcat was using the JRE 1.5.07 client VM. I changed the VM used by Tomcat and it succeeded. Hibernate Tools still fails to read the configuration file.
If any further information is required, I'd be happy to provide it. There is a forum thread (http://forum.hibernate.org/viewtopic.php?p=2310540&sid=f14052739a96c418c3...) that describes a similar problem, but the user's fix is not feasible in this scenario.
<pre>
org.hibernate.MappingException: Could not read mappings from resource: au/com/crowncontent/precis/entries/dao/mappings.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:523)
at org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:425)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1386)
at org.hibernate.console.ConsoleConfiguration.loadConfigurationXML(ConsoleConfiguration.java:225)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:172)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:148)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:129)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:109)
at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:54)
at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:63)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
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:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:571)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:520)
... 39 more
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'entity-mappings'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1944)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.AnnotationConfiguration.addInputStream(AnnotationConfiguration.java:567)
... 40 more
</pre>
ORM XML:
<pre>
<entity-mappings
xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0">
<package>au.com.blah.entries</package>
<entity class="Entry" metadata-complete="false">
<named-query name="entries.Entry.searchEntries">
<query>
select ...
etc etc
</query>
<hint name="org.hibernate.readOnly" value="true"/>
<hint name="org.hibernate.fetchSize" value="50"/>
</named-query>
</entity>
</entity-mappings>
</pre>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 1 month
[Hibernate-JIRA] Created: (HHH-2000) CLONE -merge() with one-to-one throws ClassCastException
by Marco Rothe (JIRA)
CLONE -merge() with one-to-one throws ClassCastException
--------------------------------------------------------
Key: HHH-2000
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2000
Project: Hibernate3
Type: Bug
Components: core
Versions: 3.1 beta 2
Reporter: Marco Rothe
Hibernate tries to bind a persistent object to a long variable in a SQL statement during a call to merge() on an object with a one-to-one relation.
I originally posted about this problem here: http://forum.hibernate.org/viewtopic.php?t=948272&highlight=
I have created and attached a junit test to reproduce the problem. When running against 3.0 or 3.1beta2 the ClassCastException is thrown all the way out, as shown in the forum post. The latest code from cvs catches the exception and logs it. org.hibernate.type.NullableType.java rev 1.10 is where the exception is caught. It seems like it should be logged and then re-thrown, but it's not. The debug log from the start of the merge() call to where it logs that it failed to bind the value is:
[junit] 11:12:32,461 DEBUG SessionImpl:271 - opened session at timestamp: 11283595524
[junit] 11:12:32,461 DEBUG JDBCTransaction:54 - begin
[junit] 11:12:32,461 DEBUG ConnectionManager:309 - opening JDBC connection
[junit] 11:12:32,461 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
[junit] 11:12:32,461 DEBUG DriverManagerConnectionProvider:99 - using pooled JDBC connection, pool size: 0
[junit] 11:12:32,461 DEBUG JDBCTransaction:59 - current autocommit status: false
[junit] 11:12:32,461 DEBUG JDBCContext:207 - before transaction completion
[junit] 11:12:32,477 DEBUG IdentifierValue:207 - id unsaved-value: null
[junit] 11:12:32,477 DEBUG AbstractSaveEventListener:470 - detached instance of: org.hibernate.test.onetoone.merge.Person
[junit] 11:12:32,477 DEBUG DefaultMergeEventListener:185 - merging detached instance
[junit] 11:12:32,477 DEBUG DefaultLoadEventListener:153 - loading entity: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,477 DEBUG DefaultLoadEventListener:304 - attempting to resolve: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,477 DEBUG DefaultLoadEventListener:340 - object not resolved in any cache: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,477 DEBUG ConnectionManager:389 - running Session.finalize()
[junit] 11:12:32,477 DEBUG AbstractEntityPersister:2722 - Fetching entity: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,493 DEBUG Loader:1774 - loading entity: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,493 DEBUG AbstractBatcher:309 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] 11:12:32,493 DEBUG SQL:344 -
[junit] select
[junit] person0_.person_id as person1_0_0_
[junit] from
[junit] person person0_
[junit] where
[junit] person0_.person_id=?
[junit] 11:12:32,493 DEBUG AbstractBatcher:413 - preparing statement
[junit] 11:12:32,493 DEBUG AbstractBatcher:325 - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] 11:12:32,508 DEBUG Loader:682 - processing result set
[junit] 11:12:32,508 DEBUG Loader:687 - result set row: 0
[junit] 11:12:32,508 DEBUG Loader:1164 - result row: EntityKey[org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,508 DEBUG Loader:1347 - Initializing object from ResultSet: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,508 DEBUG AbstractEntityPersister:1859 - Hydrating entity: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,508 DEBUG Loader:709 - done processing result set (1 rows)
[junit] 11:12:32,524 DEBUG AbstractBatcher:332 - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] 11:12:32,524 DEBUG AbstractBatcher:317 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] 11:12:32,524 DEBUG AbstractBatcher:459 - closing statement
[junit] 11:12:32,524 DEBUG Loader:839 - total objects hydrated: 1
[junit] 11:12:32,524 DEBUG TwoPhaseLoad:104 - resolving associations for [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,524 DEBUG Loader:1774 - loading entity: [org.hibernate.test.onetoone.merge.Address#1]
[junit] 11:12:32,539 DEBUG AbstractBatcher:309 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] 11:12:32,539 DEBUG SQL:344 -
[junit] select
[junit] address0_.address_id as address1_1_0_,
[junit] address0_.person_id as person2_1_0_
[junit] from
[junit] address address0_
[junit] where
[junit] address0_.person_id=?
[junit] 11:12:32,555 DEBUG AbstractBatcher:413 - preparing statement
[junit] 11:12:32,555 DEBUG AbstractBatcher:325 - about to open ResultSet (open ResultSets: 0, globally: 0)
[junit] 11:12:32,555 DEBUG Loader:682 - processing result set
[junit] 11:12:32,571 DEBUG Loader:687 - result set row: 0
[junit] 11:12:32,571 DEBUG Loader:1164 - result row: EntityKey[org.hibernate.test.onetoone.merge.Address#2]
[junit] 11:12:32,571 DEBUG Loader:1347 - Initializing object from ResultSet: [org.hibernate.test.onetoone.merge.Address#2]
[junit] 11:12:32,571 DEBUG AbstractEntityPersister:1859 - Hydrating entity: [org.hibernate.test.onetoone.merge.Address#2]
[junit] 11:12:32,571 DEBUG Loader:709 - done processing result set (1 rows)
[junit] 11:12:32,571 DEBUG AbstractBatcher:332 - about to close ResultSet (open ResultSets: 1, globally: 1)
[junit] 11:12:32,571 DEBUG AbstractBatcher:317 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] 11:12:32,571 DEBUG AbstractBatcher:459 - closing statement
[junit] 11:12:32,586 DEBUG Loader:839 - total objects hydrated: 1
[junit] 11:12:32,586 DEBUG TwoPhaseLoad:104 - resolving associations for [org.hibernate.test.onetoone.merge.Address#2]
[junit] 11:12:32,586 DEBUG DefaultLoadEventListener:153 - loading entity: [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,586 DEBUG DefaultLoadEventListener:222 - entity found in session cache
[junit] 11:12:32,602 DEBUG TwoPhaseLoad:203 - done materializing entity [org.hibernate.test.onetoone.merge.Address#2]
[junit] 11:12:32,602 DEBUG Loader:1805 - done entity load
[junit] 11:12:32,602 DEBUG TwoPhaseLoad:203 - done materializing entity [org.hibernate.test.onetoone.merge.Person#1]
[junit] 11:12:32,602 DEBUG StatefulPersistenceContext:784 - initializing non-lazy collections
[junit] 11:12:32,602 DEBUG Loader:1805 - done entity load
[junit] 11:12:32,602 DEBUG Loader:1774 - loading entity: [org.hibernate.test.onetoone.merge.Address#org.hibernate.test.onetoone.merge.Person@153f67e]
[junit] 11:12:32,602 DEBUG AbstractBatcher:309 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
[junit] 11:12:32,602 DEBUG SQL:344 -
[junit] select
[junit] address0_.address_id as address1_1_0_,
[junit] address0_.person_id as person2_1_0_
[junit] from
[junit] address address0_
[junit] where
[junit] address0_.person_id=?
[junit] 11:12:32,618 DEBUG AbstractBatcher:413 - preparing statement
[junit] 11:12:32,618 INFO LongType:89 - could not bind value 'org.hibernate.test.onetoone.merge.Person@153f67e' to parameter: 1
Running the test on HSQLDB with the latest from cvs hides the problem (logs it as INFO, but doesn't complain that nothing is bound to the variable), but if you run on PostgreSQL, for example, it complains (SQLException) that nothing is bound to the variable when the statement is executed ( org.postgresql.util.PSQLException: No value specified for parameter 1.):
[junit] 11:12:32,633 DEBUG AbstractBatcher:317 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
[junit] 11:12:32,633 DEBUG AbstractBatcher:459 - closing statement
[junit] 11:12:32,649 DEBUG JDBCExceptionReporter:63 - could not load an entity: [org.hibernate.test.onetoone.merge.Address#org.hibernate.test.onetoone.merge.Person@153f67e] [select address0_.address_id as address1_1_0_, address0_.person_id as person2_1_0_ from address address0_ where address0_.person_id=?]
[junit] org.postgresql.util.PSQLException: No value specified for parameter 1.
[junit] at org.postgresql.core.v3.SimpleParameterList.checkAllParametersSet(SimpleParameterList.java:102)
[junit] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:166)
[junit] at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
[junit] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
[junit] at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
[junit] at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
[junit] at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
[junit] at org.hibernate.loader.Loader.doQuery(Loader.java:662)
[junit] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
[junit] at org.hibernate.loader.Loader.loadEntity(Loader.java:1782)
[junit] at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)
[junit] at org.hibernate.loader.entity.EntityLoader.loadByUniqueKey(EntityLoader.java:85)
[junit] at org.hibernate.persister.entity.AbstractEntityPersister.loadByUniqueKey(AbstractEntityPersister.java:1522)
[junit] at org.hibernate.type.EntityType.loadByUniqueKey(EntityType.java:365)
[junit] at org.hibernate.type.EntityType.resolve(EntityType.java:306)
[junit] at org.hibernate.type.EntityType.replace(EntityType.java:207)
[junit] at org.hibernate.type.TypeFactory.replace(TypeFactory.java:431)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.copyValues(DefaultMergeEventListener.java:279)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:245)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:102)
[junit] at org.hibernate.event.def.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:53)
[junit] at org.hibernate.impl.SessionImpl.fireMerge(SessionImpl.java:609)
[junit] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:595)
[junit] at org.hibernate.impl.SessionImpl.merge(SessionImpl.java:599)
[junit] at org.hibernate.test.onetoone.merge.OneToOneTest.testOne(OneToOneTest.java:52)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at org.hibernate.test.TestCase.runTest(TestCase.java:140)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
[junit] 11:12:32,664 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState: 22023
[junit] 11:12:32,664 ERROR JDBCExceptionReporter:72 - No value specified for parameter 1.
[junit] 11:12:32,680 DEBUG SessionImpl:290 - closing session
[junit] 11:12:32,680 DEBUG ConnectionManager:330 - closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
[junit] 11:12:32,680 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
[junit] 11:12:32,680 INFO SessionFactoryImpl:865 - closing
[junit] 11:12:32,680 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:postgresql://localhost:5432/hibtest
[junit] 11:12:32,680 INFO SchemaExport:153 - Running hbm2ddl schema export
[junit] 11:12:32,696 DEBUG SchemaExport:171 - import file not found: /import.sql
[junit] 11:12:32,696 INFO SchemaExport:180 - exporting generated schema to database
[junit] 11:12:32,696 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
[junit] 11:12:32,696 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
[junit] 11:12:32,774 DEBUG DriverManagerConnectionProvider:115 - created connection to: jdbc:postgresql://localhost:5432/hibtest, Isolation Level: 2
[junit] 11:12:32,789 DEBUG SchemaExport:283 -
[junit] alter table address
[junit] drop constraint FKBB979BF4986F6BA3
[junit] 11:12:32,805 DEBUG SchemaExport:283 -
[junit] drop table address
[junit] 11:12:32,836 DEBUG SchemaExport:283 -
[junit] drop table person
[junit] 11:12:32,867 DEBUG SchemaExport:283 -
[junit] drop sequence hibernate_sequence
[junit] 11:12:32,883 INFO SchemaExport:200 - schema export complete
[junit] 11:12:32,883 DEBUG DriverManagerConnectionProvider:129 - returning connection to pool, pool size: 1
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 5.233 sec
[junit] Test org.hibernate.test.onetoone.merge.OneToOneTest FAILED
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
17 years, 1 month