[Hibernate-JIRA] Created: (HSEARCH-233) Only one @IndexedEmbedded collection working in my entity.
by sam doyle (JIRA)
Only one @IndexedEmbedded collection working in my entity.
----------------------------------------------------------
Key: HSEARCH-233
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-233
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.0.1.GA
Environment: JBoss AS 4.2.2 Windows
Reporter: sam doyle
Attachments: jiraFiles.tar.gz
This is supposedly pretty basic functionality so perhaps it is my particular case that it is causing it.
In the attachment files the EmtVenue class is the root of the indexing.
It contains two @IndexedEmbedded
@OneToMany( cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "emtVenue" )
@IndexedEmbedded
public Set<ClientGroupVenue> getClientGroupVenues()
@Embedded
@ManyToOne( fetch = FetchType.LAZY )
@JoinColumns( { @JoinColumn( nullable = false, name = "HOST", referencedColumnName = "HOST" ),
@JoinColumn( nullable = false, name = "zone", referencedColumnName = "ZONE" ) } )
@NotNull
@IndexedEmbedded
public Zones getZones()
In this case when I index EmtVenue the resulting index contains only values that correspond to Zones and no ClientGroupVenues.
When I comment out the @IndexedEmbedded on the Zones the resulting index does show the categories.
One side note that might be of interest is indexing of Zones results in referencing some entities which don't exist that I'm catching due to the data not being in sync.
--
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, 11 months
[Hibernate-JIRA] Created: (HHH-2354) Schema validation too rigid for MySql enums
by Zeljko Trogrlic (JIRA)
Schema validation too rigid for MySql enums
-------------------------------------------
Key: HHH-2354
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2354
Project: Hibernate3
Type: Bug
Components: metamodel
Environment: jboss-seam-1.1.0.GA, MySQL 5
Reporter: Zeljko Trogrlic
Enum column type in MySQL is handled as CHAR in their JDBC driver and should be mapped to String Java type.
However, Hibernate expects varchar(n) and fails to do the validation.
This is how DatabaseMetaData.getColumns describes it:
DATA_TYPE=1
TYPE_NAME=enum
Note that although TYPE_NAME is enum, DATA_TYPE represents CHAR.
Hibernate reports following exception:
13:49:31,397 INFO [TableMetadata] table found: configuration.userdb_domain_acl
13:49:31,397 INFO [TableMetadata] columns: [id, enabled, tablename, domain]
13:49:31,397 WARN [ServiceController] Problem starting service persistence.units:ear=msmgui.ear,unitName=msmgui
javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: enabled, expected: varchar(
2)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:698)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Validation should be fixed/relaxed to avoid this problem.
--
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, 12 months
[Hibernate-JIRA] Created: (EJB-277) allow string values for query hints
by Norman Richards (JIRA)
allow string values for query hints
-----------------------------------
Key: EJB-277
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-277
Project: Hibernate Entity Manager
Type: Improvement
Reporter: Norman Richards
It seems that some string values are not accepted as query hint values in hibernate. In specific, I was trying to convert a simple query that uses setHint("org.hibernate.cacheable", true) to use an XML-defined EntityQuery that uses
<framework:entity-query name="allCategories"
ejbql="select c from Category c"
order="c.name">
<framework:hints>
<key>org.hibernate.cacheable</key>
<value>true</value>
</framework:hints>
</framework:entity-query>
Unfortunately, this fails with an IllegalArgumentException:
Caused by: java.lang.IllegalArgumentException: Value for hint
at org.hibernate.ejb.QueryImpl.setHint(QueryImpl.java:160)
at org.jboss.seam.framework.EntityQuery.createQuery(EntityQuery.java:114)
at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:41)
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)
...
Although I didn't try it, I would assume this would also fail from a @QueryHint in on a named query since that annotation only accepts a string
value.
I don't think this is technically a bug, but it would be very convenient if all the hints could accept string values.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-3078) Problem with multiple classloaders and cglib proxy enhancement, e.g. in the usual tomcat configuration
by Pietu Pohjalainen (JIRA)
Problem with multiple classloaders and cglib proxy enhancement, e.g. in the usual tomcat configuration
------------------------------------------------------------------------------------------------------
Key: HHH-3078
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3078
Project: Hibernate3
Issue Type: Bug
Components: build
Affects Versions: 3.2.5, 3.1.3
Environment: Verified against Hibernate 3.1.3 and Hibernate 3.2.5ga.
Reporter: Pietu Pohjalainen
Attachments: hibernate-3.2.patch, LoadOrderTest.tar.gz
In an usual tomcat classloader configuration, with hibernate3.jar residing in the Tomcat's common class loader and webapplications staying in their own classloaders, the cglib's proxy enhancement fails sometimes, as it tries to load the web application's classes via the Tomcat's common class loader.
The main culprit is the interaction between Hibernate's PojoEntityTuplizer and cglib's AbstractClassGenerator.
PojoEntityTuplizer passes a Set of interfaces to cglib for proxy enhancement. The set is constructed in method buildProxyFactory(PersistentClass, Getter, Setter). Now, depending on the interface classes hash codes, the order of included interfaces varies: sometimes Hibernate's HibernateProxy.class is the first one, sometimes it is the enhanced interface's class.
Problems rise when the Set's iterator gives the interfaces in order of {HibernateProxy.class, InterfaceToBeEnhanced.class}. When performing the enhancing, the cglib chooses the first interface class's classloader to find all the other classes as well. Because HibernateProxy.class was loaded by Tomcat's common class loader, it cannot find the application's class InterfaceToBeEnhanced. Thus a ClassDefNotFoundError is thrown.
There's a JUnit test demonstrating the case. Because the hashCodes of loaded classes is quite undeterministic (read: beyond my skills to make deterministic), I've included ten interface classes that should be cglib-enhanced. Most often, one of these enhancements fails, due to this bug.
A fix would be to change hibernate to prioritize the application's interface classes over Hibernate's HibernateProxy.class in the set. This could be implemented by using LinkedHashSet instead of HashSet, and adding the HibernateProxy.class as the last one. This change does not introduce any faults to existing unit test sets, but allows the attaches JUnit test to run without failures. The attached patch is for Hibernate 3.2.5ga.
--
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
16 years
[Hibernate-JIRA] Created: (HHH-2077) Providing an escape sequence for Criteria queries
by Tobias Dietl (JIRA)
Providing an escape sequence for Criteria queries
-------------------------------------------------
Key: HHH-2077
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2077
Project: Hibernate3
Type: Improvement
Components: query-criteria
Versions: 3.1.3, 3.2.0 cr1, 3.2.0.cr2, 3.2.0.cr3, 3.2.0.cr4
Environment: Hibernate 3.1.3, MySQL, HSQLDB, Oracle
Reporter: Tobias Dietl
Up to now, there is no way of setting the escape sequence to use for string comparisions with like for Criteria queries.
This is necessary as MySQL on the one hand and HSQLDB / Oracle on the other behave differently...
If you want to search for '_abc' in MySQL, you have to use:
value like '\\_abc'
In Oracle or HsqlDB, you have to use:
value like '\_abc'
If you want to switch to another escape sequence like '|' , you can set it in HQL with value like '|_abc' escape '|'. Unfortunately, there is no way of setting it for Criteria queries, which would force me to rewrite all my Criteria queries in HQL. It would really be nice if the feature/improvement would be added...
--
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
16 years
[Hibernate-JIRA] Created: (HHH-3303) Parameters bound in wrong order for IN-clauses on dynamic components
by Holger Engels (JIRA)
Parameters bound in wrong order for IN-clauses on dynamic components
--------------------------------------------------------------------
Key: HHH-3303
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3303
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.6
Reporter: Holger Engels
When issuing the following query, the parameters are bound in wrong order:
List<Map> keys = Arrays.asList(CollectionUtil.map("mandator", "M", "key", "test"), CollectionUtil.map("mandator", "M", "key", "user"));
list = session.createCriteria(Profile.class).add(Restrictions.in("key", keys)).list();
// list.size() = 0, should be 2
[DEBUG] 15:24:45 [org.hibernate.SQL ]: select this_.id as id7_0_, this_.version as version7_0_, this_.key_mandator as key3_7_0_, this_.key_key as key4_7_0_, this_.created as created7_0_, this_.createdBy as createdBy7_0_, this_.modified as modified7_0_, this_.name as name7_0_ from auth_profile this_ where (this_.key_mandator, this_.key_key) in ((?, ?), (?, ?))
Hibernate: select this_.id as id7_0_, this_.version as version7_0_, this_.key_mandator as key3_7_0_, this_.key_key as key4_7_0_, this_.created as created7_0_, this_.createdBy as createdBy7_0_, this_.modified as modified7_0_, this_.name as name7_0_ from auth_profile this_ where (this_.key_mandator, this_.key_key) in ((?, ?), (?, ?))
[DEBUG] 15:24:45 [nate.jdbc.AbstractBatcher]: preparing statement
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'M' to parameter: 1
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'M' to parameter: 2
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'test' to parameter: 3
[DEBUG] 15:24:45 [hibernate.type.StringType]: binding 'user' to parameter: 4
It should be:
binding 'M' to parameter: 1
binding 'test' to parameter: 2
binding 'M' to parameter: 3
binding 'user' to parameter: 4
The mapping for key is:
<dynamic-component name="key" unique="true">
<property name="mandator" column="key_mandator" type="string" length="4"/>
<property name="key" column="key_key" type="string" length="16"/>
</dynamic-component>
Interestingly, the same query works in HQL:
Query query = session.createQuery("from Profile where key in (:keys)");
query.setParameterList("keys", keys);
list = query.list();
// list.size() = 2
--
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
16 years