[Hibernate-JIRA] Created: (HBX-1028) Eclipse (3.3.1) - Hibernate Tools plugin - structured hbm.xml editor does not resolve external entity references kept in an external DTD file that is referenced in the hbm.xml file
by Amit Pradhan (JIRA)
Eclipse (3.3.1) - Hibernate Tools plugin - structured hbm.xml editor does not resolve external entity references kept in an external DTD file that is referenced in the hbm.xml file
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: HBX-1028
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1028
Project: Hibernate Tools
Issue Type: Bug
Components: eclipse, visualizations
Affects Versions: 3.2.0.GA
Environment: Windows XP Pro, Eclipse 3.3.1, Hibernate Tools plugin w/ all prerequisite plugins (WTP, JBoss stable update & Europa sites) installed
Reporter: Amit Pradhan
Attachments: HibernateScreenshot.doc
[Reference - Hibernate Tools forum - Title - Eclipse,Hibernate Plugin, External DTD, Hibernate XML Editor] - Initial posting below:
The below external reference to globals DTD (per pg. 137 in Java Persistence w/ Hibernate book) works when I run hbm2ddl as an ant task. I added the HibernateTool plugin into Eclipse (3.3.1.1). In the Hibernate tools perspective, I've created a console configuration & specified under "options" the entity resolver: "org.hibernate.util.DTDEntityResolver". No errors so far.
When I open the Role.hbm.xml file (Java Perspective) using "Open with.." "Hibernate 3.0 XML Editor" the external dtd references are not resolved in the Hibernate 3.0 XML Editor window.
Dir. struct. is - src/com/t0/{Role.java, Role.hbm.xml, IRglobals.dtd}
Class struct. is - classes/com/t0/{Role.class, Role.hbm.xml, IRglobals.dtd}
-------------------
My globals dtd is IRglobals.dtd:
<!ENTITY SeqS10000I1C20
'<param name="parameters">start with 10000 increment by 1 cache 20</param>'
>
------------------------
My Role.hbm.xml is:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"
[
<!ENTITY % IRGlobals SYSTEM "classpath://com/t0/IRGlobals.dtd"> %IRGlobals;
]>
<hibernate-mapping package="com.t0">
<class name="Role">
<id name="roleId" type="long">
<generator class="sequence">
<param name="sequence">ir_role_seq</param>
&SeqS10000I1C20;
</generator>
</id>
<property name="name" type="string" length="10" unique="true" not-null="true" ></property>
</class>
</hibernate-mapping>
------------------------
If I replace the external reference to the DTD w/ an inline reference to the entity, then the Hibernate 3.0 XML editor resolves it. Since I have several hbm files & several global refs in my project, I'd prefer to just reference the IRglobals.dtd in all my hbm files.
Any suggestions on how to get the references from an external global dtd file resolved in the Hibernate 3.0 XML editor would be appreciated.
amit
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HHH-3039) Undecipherable exception reported with incomplete hibernate.cfg.xml
by Matthias Haack (JIRA)
Undecipherable exception reported with incomplete hibernate.cfg.xml
-------------------------------------------------------------------
Key: HHH-3039
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3039
Project: Hibernate3
Issue Type: Improvement
Components: core
Affects Versions: 3.2.5
Environment: hibernate 3.2.5
apache derby 10.3
Reporter: Matthias Haack
Priority: Minor
Attachments: hibernate.cfg.xml
While loading the hibernate.cfg.xml file the following log was created:
29.12.2007 20:49:46 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.5
29.12.2007 20:49:46 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
29.12.2007 20:49:46 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
29.12.2007 20:49:46 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
29.12.2007 20:49:46 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
29.12.2007 20:49:46 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
Initial SessionFactory creation failed.java.lang.NullPointerException
No hint given what caused the exception. Turned out to be there is no special handling is implemented in class org.hibernate.cfg.Configuration at line 1529.
This happens while calling "new Configuration().configure().buildSessionFactory();" on the attached configuration file; this file if course is not correct (it's a mapping file, not a config file).
Proper error reporting would help the end user.
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HHH-3038) HQL with subquery that contains join with CollectionOfElements generates SQL missing a table
by Rodrigo Cesar Gevaerd de Faria (JIRA)
HQL with subquery that contains join with CollectionOfElements generates SQL missing a table
--------------------------------------------------------------------------------------------
Key: HHH-3038
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3038
Project: Hibernate3
Issue Type: Bug
Components: query-hql
Affects Versions: 3.2.5
Environment: hibernate core 3.2.5.GA, hibernate annotations 3.3.0.GA, MS SQL Server 2000
Reporter: Rodrigo Cesar Gevaerd de Faria
The HQL
select v.id from ContentVersion v where :si = any ( from v.publications p join p.serviceInstanceIds psi)
is generating the following invalid SQL:
select
contentver0_.id as col_0_0_
from
lum_ContentVersion contentver0_
where
?=any (
select
publicatio1_.id
from
inner join
lum_ContentPubServiceInst serviceins2_
on publicatio1_.id=serviceins2_.contentPublicationId
where
contentver0_.id=publicatio1_.contentVersionId
)
Note that there is a table missing in the FROM in the subquery (the publicatio1_ table is missing just before the inner join clause). This always happens when I try to join with a @CollectionOfElements inside a subquery (in this case, it is the "serviceInstanceIds" attribute). If instead I join with another entity, the sql is generated correctly.
--
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
18 years, 3 months
[Hibernate-JIRA] Created: (HHH-3037) SizeExpression doesn't work for a collection that's defined on a base class
by Daniel Kandel (JIRA)
SizeExpression doesn't work for a collection that's defined on a base class
---------------------------------------------------------------------------
Key: HHH-3037
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3037
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.2
Reporter: Daniel Kandel
When using SizeExpression in a criteria on a collection defined in a base class, a MappingException (unknown collection role) is thrown.
A short example:
abstract class A {
@OneToMany
Set<B> bSet;
}
class C extends A {}
A SizeExpression is used for a criteria on class C (referencing the collection of class B).
In SizeExpression.toSqlString, the role is calculated this way:
String role = criteriaQuery.getEntityName(criteria, propertyName) + '.' + criteriaQuery.getPropertyName(propertyName)
This causes the role to be: C.bSet, which causes the MappingException.
I think the role should be calculated using the PropertyMapping (the same way it is in AbstractEmptinessExpression):
SessionFactoryImplementor factory = criteriaQuery.getFactory();
String entityName = criteriaQuery.getEntityName(criteria, propertyName);
PropertyMapping ownerMapping = ( PropertyMapping ) factory.getEntityPersister(entityName);
Type type = ownerMapping.toType( propertyName );
if ( !type.isCollectionType() ) {
throw new MappingException("Property path [" + entityName + "." + propertyName + "] does not reference a collection");
}
String role = ( (CollectionType) type ).getRole();
This seems to work for me (the role is A.bSet).
--
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
18 years, 3 months
[Hibernate-JIRA] Updated: (HHH-1570) criteria-api: filtering by key-many-to-one causes invalid sql
by Hasan Ceylan (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1570?page=c... ]
Hasan Ceylan updated HHH-1570:
------------------------------
Attachment: hibernate.patch
First of all please ignore my previous comment.
Solution was rubbish and the workaround was partial.
Let me also congratulate the hibernate developers (to my knowledge) for the most comprehensive unit tested project.
As we moved into deployment phase in our project where we are heavily dependent on existing databases we have a lot of cases where the child class has composite primary key of which has Many-to-One relation with the parent.
I think missing the joins relies in trying to locate the joins only in properties but not in id fields.
Attached patch makes hibernate also go through the primary key fields in joins. I have put a lot of effort to make it up to the quality of hibernate. Nevertheless, it still has couple of tests failing. But this is like 7, as far as I remember. And given my schedule at least for now, I have no more time to go through them.
Hope to see the patch go main stream,
Regards,
Hasan Ceylan
> criteria-api: filtering by key-many-to-one causes invalid sql
> -------------------------------------------------------------
>
> Key: HHH-1570
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1570
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.1.2
> Reporter: Joris Verschoor
> Attachments: hibernate.patch
>
>
> We have a class Price that has a composite-id using a couple of key-properties and some key-many-to-ones)
> One of those is "transportation", which has a many-to-one to transportationType
> When we query using: criteria.add(Expression.eq("price.transportation.transportationType.id", transId);, we get an invalid SQL statement: The table of transportation was not selected.
> I will try to make a testcase today or tomorrow, depending on my schedule.. Things will be more clear by then...
> We have created a work-around, by mapping the transportationID twice: once in key-property, and once as a many-to-one. (instead of one key-many-to-one)
--
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
18 years, 3 months