[Hibernate-JIRA] Created: (HSEARCH-753) fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
by Mathieu Perez (JIRA)
fullTextQuery.getResultList().size() != fullTextQuery.getResultSize() when using criteria
-----------------------------------------------------------------------------------------
Key: HSEARCH-753
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-753
Project: Hibernate Search
Issue Type: Bug
Components: query
Affects Versions: 3.4.0.Final
Environment: hibernate 3.6.4.Final / postgresSQL
Reporter: Mathieu Perez
1) My indexes are up-to-date and optimised
2) I'm aware about this part of documentation: "Like Google, the number of results is approximative if the index is not fully up-to-date with the database (asynchronous cluster for example)."
3) Two types of queries:
3.1) Query with "keyword" (or "below"/"above"/"fromTo")
{code}
QueryBuilder qb = fullTextSession.getSearchFactory().buildQueryBuilder().forEntity( Book.class ).get();
org.apache.lucene.search.Query query = qb
.keyword()
.onFields("title", "subtitle", "authors.name", "publicationDate")
.matching("Java rocks!");
.createQuery();
{code}
In this case, I don't meet any problem:
query.getResultSize() == query.getResultList().size()
3.2) Query with criteria
{code}
Criteria criteria = s.createCriteria( Book.class ).createCriteria('isbn').add(Restrictions.like('XXXXXX'))
Query q = s.createFullTextQuery( luceneQuery ).setCriteriaQuery( criteria );
{code}
In this case, the result is different:
{code}
query.getResultSize() != query.getResultList().size()
{code}
Actually, query.getResultSize() exactly returns the number of Book contained in my Book's table. (select count(*) from Book;) without taking in consideration my criteria.
I don't known if it's really a bug either it's the expected behaviour.
When inspecting the org.hibernate.search.query.engine.impl.HSQueryImpl java class, I realized that
{code}
QueryHits queryHits = getQueryHits( searcher, 0 ) :
{code}
- 3.1) Takes in charge my keyword
- 3.2) Doesn't seem to use my criteria
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HSEARCH-758) create DirectoryManager to handle different I/O aspects of an index
by Sanne Grinovero (JIRA)
create DirectoryManager to handle different I/O aspects of an index
-------------------------------------------------------------------
Key: HSEARCH-758
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-758
Project: Hibernate Search
Issue Type: Improvement
Reporter: Sanne Grinovero
Fix For: 4.0.0.Alpha1
Near-Real-Time Lucene usage requires a coupling between the indexwriter and the indexreaders being used for searches.
Also to make other features simpler we need to manage indexwriters and indexreaders in a more integrated form (Infinispan).
refactor : DirectoryProvider
* make a "DirectoryManager" instead, which is able to provide factories for both IndexReader an IndexWriters
* add utility methods like "getName()"
o (wish I had that in some cases to provide better error messages)
* Instead of trying to foresee all needed methods, the extension point should not be the DirectoryManager interface directly, but have people plug in different aspects.
* This is needed to eventually support:
o Instantiated indexes - HSEARCH-336
o make good use of all new so called "Near-Real-Time" Lucene improvements by having IndexReader and IndexWriter possibly generated by the same service
o reuse the JGroups channel used by the Infinispan Directory as transport for a backend (again, the two components need to interact)
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HSEARCH-539) Add Indexing Support(out of the box) For Simple Collections, Like Set<Integer>
by Zach Kurey (JIRA)
Add Indexing Support(out of the box) For Simple Collections, Like Set<Integer>
------------------------------------------------------------------------------
Key: HSEARCH-539
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-539
Project: Hibernate Search
Issue Type: New Feature
Components: mapping
Affects Versions: 3.2.0.Final
Environment: N/A
Reporter: Zach Kurey
>From both the documentation and the Hibernate Search In Action book it was unclear to me that simple collections were not able to be indexed out of the box by just adding a @IndexEmbedded or @Field annotation, and instead require a custom field bridge. When I say simple collection I mean Sets/Lists/Collections of Integer/Double/String/Float/etc. It would seem, given the already advanced indexing support in Hibernate Search, that this really should be a basic out of the box feature as I'm sure most of the folks using Search have had to implement such a bridge at some point.
Note that I could still be missing an non-obvious feature or there may be a good reason for not providing it via @IndexEmbedded or @Field automatically.
To be completely clear I have:
@CollectionOfElements
@JoinTable(name="enrollment_groups", joinColumns={@JoinColumn(name="enrollee_id")})
@Column(name="enrollment_group_id")
@IndexedEmbedded
private Set<String> utilityEnrollmentGroups;
If I were to change this to a group of embedded types, everything gets indexed just fine.
For Hibernate libraries in use I have:
Core: 3.5.2
Search: 3.2.0
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HHH-4580) Possible Sybase bug causes AssertionFailure in QueryByExampleTest
by Strong Liu (JIRA)
Possible Sybase bug causes AssertionFailure in QueryByExampleTest
-----------------------------------------------------------------
Key: HHH-4580
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4580
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.0-Beta-2, 3.5.0.Beta-1, 3.3.2, 3.2.4.sp1
Environment: sybase 15
Reporter: Strong Liu
Test QueryByExampleTest.testJunctionNotExpressionQBE fails due to a possible bug in Sybase 15. The same test passes for Sybase 12.5. The test expects two records as a result for a query, but it gets 3. After some debugging with the query that Hibernate generated, I end up with these two simpler ones:
select id from Componentizable where not (name like ? and subName1 like ?)
select id from Componentizable where not (name like 'hibernate' and subName1 like 'ope%')
The first one returns three records, while the second returns two. The interesting part is that if I replace the first parameter in the first query by a hardcoded value ("hibernate"), it still returns 3 records. That means that the problem is probably with the binding of JDBC parameters containing a wildcard % .
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (HHH-5894) [ENVERS] Loading collections from envers entity fails due to QueryException
by Sven Rienstra (JIRA)
[ENVERS] Loading collections from envers entity fails due to QueryException
---------------------------------------------------------------------------
Key: HHH-5894
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5894
Project: Hibernate Core
Issue Type: Bug
Affects Versions: 3.6.1
Environment: Hibernate 3.6.1
Oracle 10g
Ubuntu
Reporter: Sven Rienstra
Priority: Blocker
When I'm trying to load a collection from an envers entity it fails due to an incorrect HQL query:
Caused by: org.hibernate.QueryException: could not resolve property: domein_id of: nl.protopics.zwip.model.gvo.Faq_AUD [select e from nl.protopics.zwip.model.gvo.Faq_AUD e where e.domein_id = :domein_id and e.originalId.REV.id = (select max(e2.originalId.REV.id) from nl.protopics.zwip.model.gvo.Faq_AUD e2 where e2.originalId.REV.id <= :revision and e.originalId.id = e2.originalId.id) and REVTYPE != :delrevisiontype]
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:81)
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:75)
at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1465)
at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:315)
at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:487)
at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:611)
at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:263)
at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:210)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:117)
at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:113)
at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:880)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1330)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4471)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3944)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:2047)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1972)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1972)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:831)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:617)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:301)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:244)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1770)
at org.hibernate.envers.entities.mapper.relation.query.OneAuditEntityQueryGenerator.getQuery(OneAuditEntityQueryGenerator.java:99)
at org.hibernate.envers.entities.mapper.relation.lazy.initializor.AbstractCollectionInitializor.initialize(AbstractCollectionInitializor.java:62)
at org.hibernate.envers.entities.mapper.relation.lazy.proxy.CollectionProxy.checkInit(CollectionProxy.java:50)
at org.hibernate.envers.entities.mapper.relation.lazy.proxy.CollectionProxy.iterator(CollectionProxy.java:70)
mappings:
Domein class, from where I call getFaqs()
@OneToMany(cascade = CascadeType.ALL, mappedBy = "domein")
private List<Faq> faqs = new ArrayList<Faq>();
Faq mapping:
@ManyToOne
private Domein domein;
Works fine with 3.6.0.
--
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
13 years, 2 months
[Hibernate-JIRA] Created: (ANN-814) OneToOne Unidirectional Support
by Rachit (JIRA)
OneToOne Unidirectional Support
-------------------------------
Key: ANN-814
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-814
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.4.0.GA
Environment: Oracle 10g, Java 1.5
Reporter: Rachit
Priority: Blocker
I tried hard for unidirectional OneToOne mapping as below:
@Entity
@Table(name = "PARTY")
public class Party{
private Person person;
private String key;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL,)
@PrimaryKeyJoinColumn(name = "PARTY_ID", referencedColumnName = "PERSON_PARTY_ID")
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "uuid")
@Column(name = "PARTY_ID", nullable = false)
public String getKey() {
return key;
}
private void setKey(String key) {
this.key = key;
}
}
and it is one-to-one mapped to Person as:
@Entity(name = "Person")
@Table(name = "PERSON")
public class Person {
private String key;
@Id
@Column(name = "PERSON_PARTY_ID")
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
}
Now in Person, I deliberately dont have sysUUID as generated as then it generates a unique value for person and the association gets lost. With this mapping hibernate throws the following exception :
Caused by: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): Person.
I read and saw constrained="true" being used in mapping files, which I couldnt use as there is no attribute like it in OneToOne annotation.
Please help me out on this
--
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
13 years, 2 months