[Hibernate-JIRA] Created: (METAGEN-70) BasicAttributeVistor doesn't recognize subclasses of java.io.Serializeable as Attributes.
by kk (JIRA)
BasicAttributeVistor doesn't recognize subclasses of java.io.Serializeable as Attributes.
-----------------------------------------------------------------------------------------
Key: METAGEN-70
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-70
Project: Hibernate Metamodel Generator
Issue Type: Bug
Components: processor
Affects Versions: 1.1.1.Final
Reporter: kk
Assignee: Hardy Ferentschik
Situation:
Interface 'UnitPersistentValueIF' extends 'PersistentValueIF'.
Interface 'PersistentValueIF' extends 'java.io.Serializable'.
Result:
The annotationprocessor creates attributes for element 'PersistentValueIF'
The annotationprocessor doesn't create attributes for element 'UnitPersistentValueIF'
Expected result:
The annotationprocessor creates for both 'PersistentValueIF' and 'UnitPersistentValueIF' the attributes.
I have debugged the annotationprocessor and this could be the solution:
In BasicAttributeVisitor.java in method visitDeclared(DeclaredType declaredType, Element element)
there is the following code:
if ( "java.io.Serializable".equals( interfaceElement.getQualifiedName().toString() ) ) {
This code should also take into account its superclasses (or interfaces).
Can this be done with 'java.lang.model' ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 3 months
[Hibernate-JIRA] Created: (METAGEN-66) XML Based Mapping of Embeddets in Mapped-Superclass is ignored
by Ralph Engelmann (JIRA)
XML Based Mapping of Embeddets in Mapped-Superclass is ignored
--------------------------------------------------------------
Key: METAGEN-66
URL: http://opensource.atlassian.com/projects/hibernate/browse/METAGEN-66
Project: Hibernate Metamodel Generator
Issue Type: Bug
Affects Versions: 1.1.1.Final
Environment: Meta model generator for Hibernate (Version 1.1.1-Final), Hiberante 3.6.1.Final, Spring 3.0
Reporter: Ralph Engelmann
Assignee: Hardy Ferentschik
I use a Mapped Superclass, which refer to an (generic) Embeddded.
Because this class is located in an different jar I needto map this class explicit in XML.
But the Hibernate Model Generator does not create an field in the Meta Model of the Mapped Superclass that represent the Embedded.
See the code for illustration.
{code:title=Mapped Superclass(BusinessEntity<T>)}
public abstract class BusinessEntity<T extends Serializable>
implements Serializable {
private Long id;
private BusinessId<T> businessId;
...
}
{code}
{code:title=Generic Embedded (BusinessId<T>)}
public class BusinessId<T> implements Serializable {
private long businessId;
...
}
{code}
{code:title=orm.xml}
<?xml version="1.0" encoding="UTF-8"?>
<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
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<mapped-superclass class="BusinessEntity"
access="FIELD">
<attributes>
<id name="id">
<column nullable="false"/>
<generated-value strategy="AUTO"/>
</id>
<embedded name="businessId"/>
</attributes>
</mapped-superclass>
<embeddable class="BusinessId"
access="FIELD">
<attributes>
<basic name="businessId">
<column nullable="false" unique="true"/>
</basic>
</attributes>
</embeddable>
</entity-mappings>
{code}
{code:title=Generated Meta Model (BusinessEntity_)}
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@StaticMetamodel(BusinessEntity.class)
public abstract class BusinessEntity_ {
public static volatile SingularAttribute<BusinessEntity, Long> id;
}
{code}
{code:title=Generated Meta Model (BusinessId_)}
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@StaticMetamodel(BusinessId.class)
public abstract class BusinessId_ {
public static volatile SingularAttribute<BusinessId, Long> businessId;
}
{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
14 years, 3 months
[Hibernate-JIRA] Created: (HHH-3383) QueryKey is storing references to entities instead of identifiers
by Manuel Dominguez Sarmiento (JIRA)
QueryKey is storing references to entities instead of identifiers
-----------------------------------------------------------------
Key: HHH-3383
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3383
Project: Hibernate3
Issue Type: Improvement
Components: caching (L2)
Affects Versions: 3.3.0.CR1
Environment: ehcache 1.5.0b2
Reporter: Manuel Dominguez Sarmiento
Context: query caching
Hibernate is storing full entity references when building QueryKeys and the query has restrictions which reference entities. This happens either with Criteria or HQL queries.
Although this is not incorrect, when the referenced entities reference in turn "heavy" object graphs, this causes a very significant memory usage increase, since references to detached entities will remain in the cache. This is even more evident when using disk persistence with ehcache, since the full object graphs are serialized to disk.
This could be easily improved (correct me if I'm wrong) by storing ONLY entity identifiers in the QueryKey instead of full entities, since all the query really needs is the identifier property. The memory usage would decrease dramatically.
So far the workaround we've found is explicitly using restrictions that reference identifiers instead of properties in HQL queries, however this is not particularly elegant, and still leaves open the issue with Criteria queries. The same cannot be done without criteria.createCriteria() which generates an unnecessary join in most cases.
--
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
14 years, 3 months