[Hibernate-JIRA] Created: (HHH-3035) could not read column value from result set: MEDFAC1_14_0_; Invalid column name SQL Error: 17006, SQLState: null
by sanjeev singh (JIRA)
could not read column value from result set: MEDFAC1_14_0_; Invalid column name SQL Error: 17006, SQLState: null
----------------------------------------------------------------------------------------------------------------
Key: HHH-3035
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3035
Project: Hibernate3
Issue Type: Bug
Components: core, query-criteria, query-hql, query-sql
Affects Versions: 3.2.2
Environment: JDK5 , Hibernate Junit Test case,WIndows XP
Reporter: sanjeev singh
The following is my section of hibernate mapping file.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="gov.njdhss.hippocrates.ems.valueobjects">
<class name="HeprEmsMedfacFacilityVO" table="HEPR_MEDFAC">
<id name="medfacId" column="MEDFAC_ID" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">HEPR_MEDFAC_SEQ</param>
</generator>
</id>
<property name="medfacName" type="java.lang.String"
column="MEDFAC_NAME" update="true" insert="true">
</property>
<property name="facCode" type="java.lang.String"
column="FAC_CODE" update="true" insert="true">
</property>
</class>
<sql-query name="allfacility">
<return alias="facilities" class="HeprEmsMedfacFacilityVO" >
<return-property name="medfacName" column="MEDFAC_NAME"/>
</return>
<![CDATA[
select facilities.MEDFAC_NAME AS medfacName
from HEPR_MEDFAC facilities
]]>
</sql-query>
</hibernate-mapping>
I am trying to execute the query using the following client code:
public List getAllFacility() {
List listAllFacilities = null;
listAllFacilities = getHibernateTemplate().findByNamedQuery(
"allfacility");
return listAllFacilities;
}
The following is the error:
Hibernate:
select
facilities.MEDFAC_NAME AS medfacName
from
HEPR_MEDFAC facilities
- could not read column value from result set: MEDFAC1_14_0_; Invalid column name
- SQL Error: 17006, SQLState: null
- Invalid column name
- Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
- SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
Any idea if it is a bug or there is any error in my 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
15 years, 8 months
[Hibernate-JIRA] Commented: (HHH-1864) New dialect for Solid database for Hibernate 3.1.3 and Solid 4.5 onwards
by Stephane Epardaud (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1864?page=c... ]
Stephane Epardaud commented on HHH-1864:
----------------------------------------
Hum, 2006 and still open... Does this mean still no Solid support in Hibernate?
> New dialect for Solid database for Hibernate 3.1.3 and Solid 4.5 onwards
> ------------------------------------------------------------------------
>
> Key: HHH-1864
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1864
> Project: Hibernate Core
> Issue Type: New Feature
> Components: core
> Environment: New dialect for Solid database for Hibernate 3.1.3 and Solid 4.5 onwards
> Reporter: Dave Richardson
> Attachments: SolidDialect.java
>
>
> I have written a Dialect class for the Solid database (www.solidtech.com) release 4.5 onwards.
> The SolidDialect is designed to be used with Solid release 4.5 or later.
> It does however work with Solid release 4.2 if the new features in Solid 4.5
> are not used. These are:
> - referential actions CASCADE, SET NULL, SET DEFAULT, RESTRICT and NO ACTION.
> - syntax for windowing over the result set: SELECT ... LIMIT ... OFFSET ...
> - new functions SOUNDEX() and DIFFERENCE() for approximate string comparisons.
> - automatic removing of constraints, with: DROP TABLE ... CASCADE CONSTRAINTS.
> I ran the Hibernate test suites with the SolidDialect using Hibernate 3.1.3.
> As a baseline I also ran the test suite against HSQLDB giving the following results:
> Tests: 806, unsuccessful: 12, success rate: 98.51%
> I had initially expected 100%, but the following comment from Gavin King in the
> Hibernate Forum explains the main reason:
> "There are some expected failures in the HB3 test suite.
> Basically, some obscure stuff that we broke going from HB2->HB3 and plan to fix "someday"."
> The results with the SolidDialect are:
> Tests: 806, unsuccessful: 36, success rate: 95.53%
> This compares reasonably well with HSQLDB.
> Note: some of the Hibernate tests rely on the availability of temporary tables.
> This is supported by Solid but requires an appropriate license (with support for so-called M-tables).
> I have sent the dialect and the results of the Hibernate test suite together with a detailed analysis of the results to Solid.
> They are currently analysing this information. If necessary I can provide a contact person at Solid.
> I hope the dialect can be included in an official distribution as soon as possible.
> Test Results Analysis
> =====================
> I analyzed the results and assigned the reason for failure to the following categories:
> - Feature not currently supported by the Solid database.
> - Error or non-standard behaviour in the Solid database engine and/or JDBC driver.
> - Error or missing support in the SolidDialect for Hibernate
> - Problem with the test case itself
> - Error in Hibernate itself.
> This led to the following:
> #ERRORS CATEGORY
> 11 Feature not supported by Solid
> 17 Probable Solid error or non-standard behaviour
> 0 Problem with SolidDialect
> 6 Problem with Hibernate test case
> 2 Hibernate bug
> 36 Total errors
> I patched three test cases and corrected one bug in Hibernate to acheive these results:
> hql.ASTParserLoadingTest:
> - changed query "from Animal where bodyWeight > 1e-38"
> to "from Animal where bodyWeight > 1e-12" since Solid supports a maximum
> precision of 16 and the precision is not the focus of the test.
> legacy.MasterDetailTest:
> - There are numerous dialect checks in this test. Many tests are omitted
> depending on the dialect. For MySQL the transaction isolation level
> is explicitly set for this test case.
> The test was patched to do this for Solid too.
> readonly.ReadOnlyTest:
> The test case initialises an attribute using:
> dp.setX( new BigDecimal( 0.1d ).setScale(19, BigDecimal.ROUND_DOWN) );
> Solid supports a maximum precision of 16.
> The test case was patched to use 12 instead of 19.
> Then only testReadOnlyOnProxiesFailureExpected failed later as it does with
> HSQLDB with the following diagnostic:
> org.hibernate.TransientObjectException: Instance was not associated with the session
> at org.hibernate.engine.StatefulPersistenceContext.setReadOnly(
> StatefulPersistenceContext.java:1095)
> at org.hibernate.impl.SessionImpl.setReadOnly(SessionImpl.java:1795)
> at org.hibernate.test.readonly.ReadOnlyTest.
> testReadOnlyOnProxiesFailureExpected(ReadOnlyTest.java:50)
> Research showed that this is a known bug (HHH-1352).
> I suppose I should submit separate patches for these modified test cases?
> The Hibernate bug corrected is in the statistics gathering class StatisticsImpl
> which under certain circumstances causes the test case stats.StatsTestestQueryStatGathering
> to fail with the following diagnostic:
> junit.framework.ComparisonFailure:
> expected:<from Continent> but was:<null>
> at org.hibernate.test.stats.StatsTest.testQueryStatGathering(StatsTest.java:136)
> I'll submit a separate patch for this.
> Here are now some details about the errors:
> Category: Feature not supported by Solid
> ----------------------------------------
> Of the 11 errors due to unsupported features, 6 are caused by functions in
> ORDER BY clauses and 3 by missing support for ResultSet.getBlob().
> A further error is caused by the test case joinedsubclass.JoinedSubclassTest
> which leads to the following SQL fragment:
> where (this_.address, this_.zip, this_.country) in ((?, ?, ?), (?, ?, ?))
> This is apparently not currently supported by Solid.
> Note: this test is skipped for HSQLDB, PostgreSQL, MySQL and DB2.
> The last error due to an unsupported feature occurs in the test case
> legacy.FooBarTest.testCollectionsInSelect
> The test issues the following HQL query:
> select count(*) from Bar as bar, bar.component.glarch.proxyArray as g
> where g.id in indices(bar.baz.fooArray)
> This leads to the following SQL fragment:
> ...and ((proxyarray2_.tha_key in(select fooarray4_.i from fooArray fooarray4_ where ...))
> Solid reports an exception (comparison between incompatible types).
> proxyarray2_.tha_key is of type VARCHAR(32) and fooarray4_.i is of type INTEGER.
> Some databases apparently support this comparison.
> Note: this test is skipped for HSQLDB, MySQL, DB2 and Oracle.
> Category: Problem with Hibernate test case
> ------------------------------------------
> Of the 6 errors 5 occur in the test hql.HQLTest producing the following diagnostics:
> Old query translator did not throw an exception, the new one did
> SQL is not the same as the old SQL
> New query translator did *NOT* throw an exception, the old one did
> This was not analyzed any further since the errors also occur with HSQLDB.
> The other error was in proxy.ProxyTest.testFullyLoadedPCSerialization
> which produced the following diagnostic:
> junit.framework.AssertionFailedError:
> unexpected DP delete count expected:<50> but was:<51>
> at org.hibernate.test.proxy.ProxyTest.testFullyLoadedPCSerialization(ProxyTest.java:291)
> This test also fails with HSQLDB with the same diagnostic.
> Possibly a problem with the test itself.
> Category: Hibernate bug
> -----------------------
> readonly.ReadOnlyTest.testReadOnlyOnProxiesFailureExpected fails as follows:
> org.hibernate.TransientObjectException:
> Instance was not associated with the session
> at org.hibernate.engine.StatefulPersistenceContext.setReadOnly(StatefulPersistenceContext.java:1095) at org.hibernate.impl.SessionImpl.setReadOnly(SessionImpl.java:1795)
> at org.hibernate.test.readonly.ReadOnlyTest.testReadOnlyOnProxiesFailureExpected(ReadOnlyTest.java:50)
> Research showed that this is a known bug (HHH-1352).
> legacy.SQLLoaderTest.testReturnPropertyComponentRename fails as follows:
> java.sql.SQLException: [Solid JDBC 04.50.0058] Column not found
> This test uses a native SQL query defined in the Hibernate mapping file:
> select id, nickName as n2, name, subName as otherSubName, subName1 from Componentizable
> The error is in Hibernate trying to access the result set using subName as the
> column name instead of the defined alias otherSubName.
> Research showed that this is a known bug (HHH-1515).
> I hope the dialect meets with your approval and look forward to it
> being included in the official distribution!
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[Hibernate-JIRA] Created: (ANN-554) NPE with @Id on @OneToOne
by Loïc Minier (JIRA)
NPE with @Id on @OneToOne
-------------------------
Key: ANN-554
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-554
Project: Hibernate Annotations
Type: Bug
Versions: 3.2.1
Environment: Hibernate 3.2.2 GA, Hibernate Annotations 3.2.1, J2SE 1.6.0-b105 on Debian GNU/Linux sid, PostgreSQL 7.4
Reporter: Loïc Minier
Priority: Minor
Hi,
(Note: I originally reported this on the forum, but the lack of response suggests this might be a bug in Hibernate Annotations or Hibernate; the forum topic is at: http://forum.hibernate.org/viewtopic.php?t=970823)
I hope it's not a misuse of Hibernate, but I'm trying to use @Id on @OneToOne, and this causes the following NPE when running hbm2ddl:
java.lang.NullPointerException
at org.hibernate.util.StringHelper.qualify(StringHelper.java:264)
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass.java:196)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:56)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:287)
at org.hibernate.tool.ant.Hbm2DDLExporterTask.execute(Hbm2DDLExporterTask.java:45)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:171)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.Main.runBuild(Main.java:668)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
What I'm trying to do at the application level is:
Foo class and table
long foo_id, primary key
FooData fooData, nulllable=true
FooData class and table
foo_id references Foo(foo_id), nullable=false
This is expressed in Java as:
@Entity
@Table(name = "foo")
public class Foo {
@Id @GeneratedValue
@Column(name = "foo_id")
Long id;
@OneToOne(mappedBy = "foo", cascade = CascadeType.ALL)
FooData fooData;
...
@Entity
@Table(name = "foo_data")
public class FooData {
@Id
@OneToOne
@JoinColumn(name = "foo_id", nullable = false)
Foo foo;
This causes a NPE here.
If I use a real Id on FooData, e.g.:
@Id
@Column(name = "foo_data_id")
Long id;
it works, and I end up with:
- foo_id in table foo as a primary key
- foo_data_id in table foo_data as a primary key
- foo_id in table foo_data not null
- foo_id in table foo_data references foo_id in table foo
I don't want a foo_data_id, I don't need it, hence the lack of it which leads to the NPE.
Bye,
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
15 years, 8 months
[Hibernate-JIRA] Commented: (HHH-572) Repeated columns rejected in a collection of composite elements
by michael harris (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-572?page=co... ]
michael harris commented on HHH-572:
------------------------------------
Yes this is an issue for me as well. It seems there is no support for a one to many join with shared composite key elements, and with this bug, I can't map the join table as a composite element. The lifecycle semantics would be nice here. My only option is to map a one-to-many on an entity for the join table, and then a unique many-to-many on the join table to the child. which is a pain.
I feel this is an important issue. I feel having an entity that can be attached to any number of parents with shared composite keys is not that exotic of a use case. Support for this would save a bunch of time.
> Repeated columns rejected in a collection of composite elements
> ---------------------------------------------------------------
>
> Key: HHH-572
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-572
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.0.5
> Environment: JRE 1.4.2_08
> Reporter: Emmanuel Bourg
> Assignee: Gavin King
> Priority: Minor
>
> Repeating a column in a collection of composite elements triggers an error when the mapping is parsed, even if the property with the repeated column has the insert and update attributes set to false:
> <set name="children" table="CHILDREN">
> <key column="PARENT_ID"/>
> <composite-element class="Child">
> <property name="parentId" column="PARENT_ID" insert="false" update="false" />
> </composite-element>
> </set>
> or
> <set name="roles" table="ROLE">
> <key column="PARENT_ID"/>
> <composite-element class="Role">
> <many-to-one name="child" class="Child"/>
> <property name="childId" column="CHILD_ID" insert="false" update="false" />
> </composite-element>
> </set>
> Hibernate throws this exception:
> org.hibernate.MappingException: Repeated column in mapping for collection: Parent.children column: PARENT_ID
> at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:275)
> at org.hibernate.mapping.Collection.checkColumnDuplication(Collection.java:298)
> at org.hibernate.mapping.Collection.validate(Collection.java:255)
> at org.hibernate.mapping.Set.validate(Set.java:19)
> at org.hibernate.cfg.Configuration.validate(Configuration.java:817)
> at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:976)
> a workaround is to use a formula:
> <set name="children" table="CHILDREN">
> <key column="PARENT_ID"/>
> <composite-element class="Child">
> <property name="parentId" formula="PARENT_ID"/>
> </composite-element>
> </set>
> This works fine with the fix for HHH-539
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[Hibernate-JIRA] Created: (HBX-1032) HibernateConsoleRuntimeException: "Could not load JPA Configuration" for JavaSE JPA project
by Donatas Ciuksys (JIRA)
HibernateConsoleRuntimeException: "Could not load JPA Configuration" for JavaSE JPA project
-------------------------------------------------------------------------------------------
Key: HBX-1032
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1032
Project: Hibernate Tools
Issue Type: Bug
Affects Versions: 3.2.0.GA
Environment: Eclipse 3.3.1.1, HibernateTools 3.2.0 GA, JDK 1.6.0_03
Reporter: Donatas Ciuksys
Priority: Blocker
I have Java SE (not EE) project in Eclipse with standard structure like:
/src
/META-INF/persistence.xml
/bin
...
I try to create new Hibernate Configuration in "Hibernate Configurations" pannel. I choose project, select JPA (jdk 1.5+) option, fill in persistence unit "InventorizacijaPU", check whether Classpath tab is OK (it contains my project). Press OK. Trying to expand configuration created, I get this exception:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA based Configuration
at org.hibernate.console.ConsoleConfiguration.buildJPAConfiguration(ConsoleConfiguration.java:142)
at org.hibernate.console.ConsoleConfiguration.buildConfiguration(ConsoleConfiguration.java:496)
at org.hibernate.console.ConsoleConfiguration.access$0(ConsoleConfiguration.java:484)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:203)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:65)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:185)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:106)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:38)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:97)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:103)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:196)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.hibernate.console.HibernateConsoleRuntimeException: Persistence unit not found: 'InventorizacijaPU'.
at org.hibernate.console.ConsoleConfiguration.buildJPAConfiguration(ConsoleConfiguration.java:134)
... 11 more
This is my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="InventorizacijaPU"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>lt.mitsoft.inventorizacija.domain.BuvimoVieta</class>
<class>lt.mitsoft.inventorizacija.domain.Inventorizacija</class>
<class>lt.mitsoft.inventorizacija.domain.Irasas</class>
<class>lt.mitsoft.inventorizacija.domain.IrasuBlokas</class>
<class>lt.mitsoft.inventorizacija.domain.Preke</class>
<class>lt.mitsoft.inventorizacija.domain.Skanuotojas</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.DerbyDialect" />
<!-- <property name="hibernate.connection.url"
value="jdbc:derby:InventorizacijaDB" /> -->
<property name="hibernate.connection.url"
value="jdbc:derby://localhost:1527/InventorizacijaDB" />
<!-- <property name="hibernate.connection.driver_class"
value="org.apache.derby.jdbc.EmbeddedDriver"/> -->
<property name="hibernate.connection.driver_class"
value="org.apache.derby.jdbc.ClientDriver" />
<property name="hibernate.connection.username"
value="admin" />
<property name="hibernate.connection.password"
value="admin" />
<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.NoCacheProvider" />
<!-- <property name="hibernate.show_sql" value="true" /> -->
</properties>
</persistence-unit>
</persistence>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months