[Hibernate-JIRA] Created: (HSEARCH-221) Get Lucene Analyzer runtime (indexing)
by Kenneth Christensen (JIRA)
Get Lucene Analyzer runtime (indexing)
--------------------------------------
Key: HSEARCH-221
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-221
Project: Hibernate Search
Issue Type: Improvement
Affects Versions: 3.0.1.GA
Reporter: Kenneth Christensen
Attachments: AddLuceneWork.java, DocumentBuilder.java, Flyer.java, LuceneWorker.java, TestBean.java
I'm writing a multi-language application and I have choose to use Hibernate Search.
But it looks like Hibernate Search have some limitations in multi-language applications.
I need to use the SnowballAnalyzer and create the instance at runtime because I only know the language at runtime.
It really looks like Hibernate Search don't support runtime created analyzers for entity instances.
I have extended Hibernate Search to support the above issue - maybe you could include the code in Hibernate Search or implement something similarly.
I really need this feature/improvement :-)
Please see attached files.
Flyer - Entity used in test
TestBean - SessionBean used in test
org.hibernate.search.backend.impl.lucene.LuceneWorker - Added code to support entity instance analyzer, see performWork(AddLuceneWork work, DirectoryProvider provider) and add(Class entity, Serializable id, Document document, DirectoryProvider provider, Analyzer analyzer).
org.hibernate.search.backend.AddLuceneWork - Added code to support analyzer.
org.hibernate.search.engine.DocumentBuilder - Added code to support entity instance analyzer, see addWorkToQueue(Class entityClass, T entity, Serializable id, WorkType workType, List<LuceneWork> queue, SearchFactoryImplementor searchFactoryImplementor).
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-2787) Criteria Aggregate Projections do not JOIN additional tables on which restrictions apply
by Sami Dalouche (JIRA)
Criteria Aggregate Projections do not JOIN additional tables on which restrictions apply
----------------------------------------------------------------------------------------
Key: HHH-2787
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2787
Project: Hibernate3
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.2.5
Environment: PostgreSQL Dialect
Reporter: Sami Dalouche
Priority: Critical
Hi,
When you have a Criteria Object, on which you :
- Add Aggregate Projections such as rowCount()
- createAlias("whatever").add(Restrictions.*..)
It looks like that the "whatever" table is NOT joined, even though it is joined OK when the projections are not there.
So, here is an approximate Unit test that should throw an exception (I couldn't create a complete test case since I couldn't get the unit tests to run on my machine -any link explaining this step somewhere ?):
Criteria c1 = s.createCriteria(Enrolment.class)
.setProjection( Projections.projectionList().add(Projections.rowCount(), "rowCount") );
Criteria studentCriteria = c1.createAlias("student", "st");
studentCriteria.add(Restrictions.eq("name", "whatevername"));
It should complain saying the "st.name" alias does not exist, because the student class has not been joined.
Regards,
Sami Dalouche
--
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, 1 month
[Hibernate-JIRA] Created: (ANN-730) Still incorrect FK circularity errors
by Lars Heyden (JIRA)
Still incorrect FK circularity errors
-------------------------------------
Key: ANN-730
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-730
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.1.GA
Environment: Hibernate 3.2.6.ga, HEM3.3.2.ga, HAN3.3.1.ga,
JSE 1.6, DB2 8.2
Reporter: Lars Heyden
Attachments: cyclic-test.zip
This bug is related to ANN-694 (and some other issues).
Correctly mapped JoinedSubclasses still get reported to have circularities in their FKs which is not the case.
To reproduce the bug at least four entity classes must be in a joined class hierarchy. As in ANN-694 there is a workaround by renaming the tables to force another processing order.
I've provided a small test case:
It consists of four entities ClassA, ClassB, ClassC and ClassD mapped with InheritanceType.JOINED to the tables "class_a", "class_b", "class_c" and "class_1d". Because ClassD maps to table "class_1d" it gets processed first by the circularity check which raises the error.
--
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, 1 month
[Hibernate-JIRA] Created: (ANN-686) SubClass with EmbeddedId or IdClass containing @ManyToOne fail at startup
by Marcos Sousa (JIRA)
SubClass with EmbeddedId or IdClass containing @ManyToOne fail at startup
-------------------------------------------------------------------------
Key: ANN-686
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-686
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.1.beta1, 3.3.0.ga
Reporter: Marcos Sousa
Priority: Minor
I subclass Customer that has a EmbeddedId using JOIN inheritance strategy. My embeddable class has @ManyToOne relationship. Look the classes:
Pesson class:
@Entity
@Table(name="person")
public class Person {
@Id
private Integer personId;
private String name;
}
Embeddable class ID.
@Embeddable
public class PersonPk implements Serializable {
@ManyToOne(optional=false,
cascade={CascadeType.PERSIST,
CascadeType.REFRESH,
CascadeType.REMOVE}, fetch=FetchType.EAGER)
@JoinColumn(name="personId")
private Person person;
// ... getters and setters
}
CustomerClass:
@Entity
@Table(name="Customer")
@Inheritance(strategy=InheritanceType.JOINED)
public class Customer {
@Id
private PersonPk pk = new PersonPk();
}
Regional Custumer:
@Entity
@Table(name="AmericanCustomer")
@PrimaryKeyJoinColumn(name="personId")
@IdClass(PessoaPk.class)
public class AmericanCustomer extends Customer {
// some american customer fields..
}
This mapping throw this exception at hibernate startup:
Invocation of init method failed; nested exception is java.util.NoSuchElementException
Caused by:
java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(Unknown Source)
at org.hibernate.util.JoinedIterator.next(JoinedIterator.java:53)
at org.hibernate.cfg.Ejb3JoinColumn.buildJoinColumn(Ejb3JoinColumn.java:210)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:463)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:501)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:282)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:918)
--
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, 1 month
[Hibernate-JIRA] Created: (ANN-688) Repeated columns created for single table inheritance
by Nick Heudecker (JIRA)
Repeated columns created for single table inheritance
-----------------------------------------------------
Key: ANN-688
URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-688
Project: Hibernate Annotations
Issue Type: Bug
Affects Versions: 3.3.0.ga
Environment: Hibernate 3.2.5ga, Postgresql
Reporter: Nick Heudecker
I have the following classes:
@Entity
@Inheritance(strategy= InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="cltype", discriminatorType= DiscriminatorType.STRING, length=10)
@DiscriminatorValue("device")
public abstract class Device extends AbstractPersistent {
private System system;
@ManyToOne
public System getSystem() {
return system;
}
public void setSystem(System system) {
this.system = system;
}
}
@Entity
@DiscriminatorValue("snmp")
public class SnmpDevice extends Device {
// .... additional properties defined
}
When I try to create the SessionFactory, I'm getting the following exception:
Caused by: org.hibernate.MappingException: Repeated column in mapping for entity: model.SnmpDevice column: system_uuid (should be mapped with insert="false" update="false")
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:652)
at org.hibernate.mapping.PersistentClass.checkPropertyColumnDuplication(PersistentClass.java:674)
at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:696)
at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:450)
at org.hibernate.mapping.SingleTableSubclass.validate(SingleTableSubclass.java:43)
at org.hibernate.cfg.Configuration.validate(Configuration.java:1102)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1287)
--
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, 1 month
[Hibernate-JIRA] Created: (HHH-3151) using property-ref and not-null="true" simultaneously in collection <key> element crashes with ArgumentIllegalException
by boris schukin (JIRA)
using property-ref and not-null="true" simultaneously in collection <key> element crashes with ArgumentIllegalException
-----------------------------------------------------------------------------------------------------------------------
Key: HHH-3151
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3151
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: hibernate 3.2.5
Reporter: boris schukin
Example:
Let's we have one class "MetaMethod" and second class "MetaParameter" .
Class MetaMethod has a list of MetaParameters.
Corresponding tables are:
CREATE TABLE META_METHOD
(ID VARCHAR2(50) NOT NULL
,CODE VARCHAR2(40) NOT NULL
,BCN_CODE VARCHAR2(40) NOT NULL
,NAME VARCHAR2(100)
)
ALTER TABLE META_METHOD ADD (CONSTRAINT SK_BFN_PK PRIMARY KEY (ID))
ALTER TABLE META_METHOD ADD (CONSTRAINT SK_BFN_UK1 UNIQUE (CODE ,BCN_CODE))
CREATE TABLE META_PARAMETER
(ID VARCHAR2(50) NOT NULL
,BFN_CODE VARCHAR2(40) NOT NULL
,BCN_CODE VARCHAR2(40) NOT NULL
,SEQUENCE_NUMBER NUMBER(4,0) NOT NULL
,TYPE VARCHAR2(255) NOT NULL
)
ALTER TABLE META_PARAMETER ADD (CONSTRAINT SK_BFA_PK PRIMARY KEY (ID))
ALTER TABLE META_PARAMETER ADD (CONSTRAINT SK_BFA_UK1 UNIQUE (BFN_CODE, BCN_CODE ,SEQUENCE_NUMBER))
ALTER TABLE META_PARAMETER ADD (CONSTRAINT SK_BFA_BFN_FK1 FOREIGN KEY (BFN_CODE ,BCN_CODE) REFERENCES META_METHOD (CODE ,BCN_CODE))
You see, the foreign key (BFN_CODE ,BCN_CODE) on the table META_PARAMETER is organized by native key (CODE ,BCN_CODE) of the META_METHOD table.
Structure of classes is simple (in my opinion), so i introduce the hibernate mappings:
<class name="com.stinscoman.kernel.api.meta.MetaMethod"
table="META_METHOD" >
<id name="id" column="ID" length="40" type="long">
<generator class="assigned" />
</id>
<properties name="theKey" unique="true">
<property name="code" column="CODE" not-null="true"/>
<property name="bc" column="BCN_CODE" not-null="true" />
</properties>
<property name="name" column="NAME" />
<list name="parameters" cascade="all-delete-orphan">
<key property-ref="theKey" not-null="true" update="false">
<column name="BFN_CODE" not-null="true"/>
<column name="BCN_CODE" not-null="true"/>
</key>
<list-index column="SEQUENCE_NUMBER" />
<one-to-many class="com.stinscoman.kernel.api.meta.MetaParameter"/>
</list>
</class>
<class name="com.stinscoman.kernel.api.meta.MetaParameter"
table="SK_BFN_ARGUMENT">
<id name="id" column="ID" length="40" type="long">
<generator class="assigned"/>
</id>
</class>
Now, somewhere in hibernate session, i try to put a parameter to method
MetaMethod method = ... <the code to obtain MetaMethod object>
MetaParameter param = ... <the code to obtain MetaParameter object>
method.getParameters().add( param );
Ok. When session is flushing i always have:
Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.stinscoman.kernel.api.meta.MetaMethod.code
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:171)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:64)
at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:70)
at org.hibernate.tuple.component.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:83)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:353)
at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:348)
at org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:77)
at org.hibernate.engine.ForeignKeys$Nullifier.nullifyTransientReferences(ForeignKeys.java:47)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:282)
...
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@75a0c6
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
... 70 more
As i understand, the problem is in property-ref and not-null="true" simultaneously in collection <key> element.
--
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, 1 month