[Hibernate-JIRA] Created: (EJB-365) Can't execute query
by Radosław Smogura (JIRA)
Can't execute query
-------------------
Key: EJB-365
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-365
Project: Hibernate Entity Manager
Issue Type: Bug
Affects Versions: 3.3.2.GA
Environment: Hibernate 3.2.6
PostrgreSQL 8.0.13
Glassfish
Reporter: Radosław Smogura
Priority: Critical
Execution followed named query with followed entity
@Entity
@NamedQuery(name="Foo.test",
query="SELECT f FROM Foo f WHERE ((:bool IS NULL) OR (f.bool = :bool)) ")
public class Foo implements Serializable{
@Id
int id;
boolean bool;
public boolean isBool() {
return bool;
}
public void setBool(boolean bool) {
this.bool = bool;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
}
and parameter bool = null
causes PostgreSQL error ERROR: operator does not exist: boolean = bytea
--
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, 10 months
[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, 10 months
[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, 10 months
[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, 10 months
[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, 10 months
[Hibernate-JIRA] Created: (HBX-1085) Receiving FileNotFoundException when Openning Mapping File in a multiple-source-folder project
by Thai (JIRA)
Receiving FileNotFoundException when Openning Mapping File in a multiple-source-folder project
----------------------------------------------------------------------------------------------
Key: HBX-1085
URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-1085
Project: Hibernate Tools
Issue Type: Bug
Components: consoleconfiguration
Affects Versions: 3.2LATER
Environment: Windows XP SP3
JDK 1.6.0_01
Eclipse 3.4.0 (Ganymede)
HibernateTools plugin 3.2.4 nightly build (HibernateTools-3.2.4.200808270817-nightly)
Reporter: Thai
I received the following exception when Openning Mapping File from Hibernate perspective:
java.io.FileNotFoundException: F:\projects\bizservice\src\main\filtered-resources\org\openbiz\bizservice\domain\User.hbm.xml (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.hibernate.eclipse.console.actions.OpenFileActionUtils.getDocument(OpenFileActionUtils.java:233)
at org.hibernate.eclipse.console.actions.OpenFileActionUtils.rootClassInResource(OpenFileActionUtils.java:98)
at org.hibernate.eclipse.console.actions.OpenFileActionUtils.elementInResource(OpenFileActionUtils.java:86)
at org.hibernate.eclipse.console.actions.OpenFileActionUtils.getResource(OpenFileActionUtils.java:282)
at org.hibernate.eclipse.console.actions.OpenMappingAction.run(OpenMappingAction.java:120)
at org.hibernate.eclipse.console.actions.OpenMappingAction.run(OpenMappingAction.java:96)
at org.hibernate.eclipse.console.actions.OpenMappingAction.run(OpenMappingAction.java:71)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
I find out the root cause in the following class org.hibernate.eclipse.console.actions.OpenFileActionUtils (lines 273-282)
for (int i = 0; i < packageFragmentRoots.length && resource == null; i++) {
//search in source folders.
if (packageFragmentRoots[i].getClass() == PackageFragmentRoot.class) {
IPackageFragmentRoot packageFragmentRoot = packageFragmentRoots[i];
IPath path = packageFragmentRoot.getPath().append(file.getValue());
resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
}
}
if (resource != null &&
elementInResource(consoleConfiguration, resource, element)) return resource;
The code assumes that if resource variable is not null, then the corresponding file exists at that location. In fact, when the file doesn't exist, the method org.eclipse.core.internal.resources.Container.getFile(..) might still return a not-null value (see http://mobius.inria.fr/eclipse-doc/org/eclipse/core/resources/IContainer....). As a result, a not-null file path will be passed to OpenFileActionUtils.elementInResource(..), and a FileNotFoundException will be thrown.
* Note that my project contains more than one source folder. This issue may not happen on one-source-folder project.
--
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, 10 months