Message:
A new issue has been created in JIRA.
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-470
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HB-470
Summary: SQL Exception using a Map within a component
Type: Bug
Status: Unassigned
Priority: Major
Project: Hibernate2
Components:
core
Versions:
2.1 beta 5
Assignee:
Reporter: James Eitzmann
Created: Fri, 14 Nov 2003 10:17 AM
Updated: Fri, 14 Nov 2003 10:17 AM
Environment: nt 2000, oracle 8.1.7, 1.4.1 sdk
Description:
I have a map within a component. When I run a query, I get an SQL exception: "Invalid Column Name". It appears that the SQL hibernate is generating is not including the columns from the mapping table. This works fine in 2.0.3.
Mapping doc:
<?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="test.hibernate.Test"
table="OBJECT_STACKS"
dynamic-update="true"
>
<id name="id" column="OBJECT_ID" type="string">
<generator class="com.artesia.server.common.TeamsIdGenerator"/>
</id>
<component
name="testComponent"
class="test.hibernate.TestComponent"
insert="false"
update="true"
>
<map
name="attrMap"
table="CONTENT_OBJECT_STORAGE_ATTR"
outer-join="true"
batch-size="16"
>
<key column="OBJECT_ID"/>
<index column="ATTR_NAME" type="string"/>
<element column="ATTR_VALUE" type="string"/>
</map>
</component>
</class>
</hibernate-mapping>
Code:
package test.hibernate;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.ArrayList;
import java.util.List;
import net.sf.hibernate.Criteria;
import net.sf.hibernate.Session;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.cfg.Configuration;
import net.sf.hibernate.expression.Expression;
import oracle.jdbc.driver.OracleDriver;
/**
*
*
*/
public class Test
{
private String _id;
private TestComponent _testComponent;
public static void main(String[] args) throws Exception
{
DriverManager.registerDriver(new OracleDriver());
Connection con =
DriverManager.getConnection("jdbc:oracle:oci8:@j817", "j_adm", "j_adm");
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session s = sf.openSession(con);
ArrayList contentIdList = new ArrayList(1);
contentIdList.add("e6656575d7c572592316a2d41bbc4f0a68a7140f");
Criteria c = s.createCriteria(Test.class);
c.add(Expression.in("id", contentIdList));
List infoList = c.list();
}
/**
* @return Returns the id.
*/
public String getId()
{
return _id;
}
/**
* @param id The id to set.
*/
public void setId(String id)
{
_id = id;
}
/**
* @return Returns the testComponent.
*/
public TestComponent getTestComponent()
{
return _testComponent;
}
/**
* @param testComponent The testComponent to set.
*/
public void setTestComponent(TestComponent testComponent)
{
_testComponent = testComponent;
}
}
---------------------------------------------------------------------
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
|