[Hibernate-JIRA] Created: (HSEARCH-711) Review of org.hibernate.search.annotations.Index API (token names, parameter composition)
by Sanne Grinovero (JIRA)
Review of org.hibernate.search.annotations.Index API (token names, parameter composition)
-----------------------------------------------------------------------------------------
Key: HSEARCH-711
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-711
Project: Hibernate Search
Issue Type: Deprecation
Reporter: Sanne Grinovero
Fix For: 4.0
We're having Enum values labeled NO,TOKENIZED,UN_TOKENIZED,NO_NORMS,..
while Lucene changed these names to more suited "analyzed", "not_analyzed", etc.
Also I think it would be great to use an array of parameters instead of an enum listing all options, or maybe split the option in two:
@Field({ANALYZE,NO_NORMS})
or
@Field(analyze=YES,norms=No)
We should at least deprecate current names and use the more appropriate terms.
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-5645) Criteria.createAlias with specified criterion results in wrong parameters passed into SQL statement
by Fekete Kamosh (JIRA)
Criteria.createAlias with specified criterion results in wrong parameters passed into SQL statement
---------------------------------------------------------------------------------------------------
Key: HHH-5645
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5645
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.6
Environment: Windows XP SP2, Hibernate 3.5.6, JRE 1.6.0_14, PostgreSQL (tested also with Sybase ASE)
Reporter: Fekete Kamosh
Attachments: aliases_test.zip
Suppose to have tables A, B, C.
Relationships: A(one)=>B(many); B(one)=>C(many)
Table A is used as main entity.
For tables B and C lets *establish aliases* using method
_public Criteria createAlias(String associationPath, String alias, int joinType, *Criterion withClause*) throws HibernateException;_
Each created alias has addition Criterion to force Hibernate generate clause _"on column = column and (other_criterion_condition)"._
If aliases are created in *order B, C* everything is OK:
Resulting SQL:
_SELECT this_.table_a_character AS y0_
FROM table_a this_
LEFT OUTER JOIN table_b tablebalia1_
ON this_.table_a_id = tablebalia1_.table_a_id
AND ( tablebalia1_.table_b_date = ? )
LEFT OUTER JOIN table_c tablecalia2_
ON tablebalia1_.table_b_id = tablecalia2_.table_b_id
AND ( tablecalia2_.table_c_boolean = ? )
WHERE this_.table_a_character = ?_
Passed parameters:
*[Sun Oct 10 22:09:31 CEST 2010, false, c]*
But if aliases are created in *order C, B error occurs* as resulting SQL remains the same as already shown, but
Passed parameters are:
*[false, Sun Oct 10 22:12:13 CEST 2010, c]*
which causes SQL exception, because there are passed *parameters in wrong order to SQL statement*:
43843 [main] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 0, SQLState: 42883
43843 [main] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: operator does not exist: date = boolean
*Test example* (database tables, entities, hibernate.cfg and test file) *attached.*
--
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, 3 months
[Hibernate-JIRA] Created: (HHH-6649) One-to-many L2 caching update failed
by Lefebvre (JIRA)
One-to-many L2 caching update failed
------------------------------------
Key: HHH-6649
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6649
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2)
Affects Versions: 3.6.7
Reporter: Lefebvre
Hi,
I think I found a defect for the many-to-one association L2 caching update.
I have the mapping below, a parent have childs :
<hibernate-mapping package="xxx">
<class name="Parent" table="PARENT" select-before-update="true">
<cache usage="read-write" />
<id .../>
<set name="childs" cascade="all-delete-orphan" inverse="true" lazy="true">
<cache usage="read-write" />
<key column="FK_PARENT" />
<one-to-many class="xxx.Child" />
</set>
</class>
<class name="Child" table="CHILD" select-before-update="true">
<cache usage="read-write" />
<id .../>
<many-to-one name="parent" column="FK_PARENT" cascade="none" not-null="true" />
</class>
</hibernate-mapping>
// Retreive p1 and p2 objects
Parent p1 = Retreive parent where id=1
Parent p2 = Retreive parent where id=2
Child c1 = Retreive into p1 object child with id=1
c1.setParent(p2)
p2.addChild(c1)
getSession().update(p2);
// Close hibernate session and leave transaction
After that, if retreive p1 and p2, the 2 objects have the child c1 (into database, the FK_PARENT of the CHILD table is 2 -> p2)
Any idea ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HHH-6646) Nested derived identifies are not propperly initialized for loaded collections
by Anton Korshunov (JIRA)
Nested derived identifies are not propperly initialized for loaded collections
-------------------------------------------------------------------------------
Key: HHH-6646
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6646
Project: Hibernate Core
Issue Type: Bug
Components: core, query-hql, query-sql
Affects Versions: 4.0.0.CR2, 3.6.7
Environment: Hibernate 3.6.7.Final and 4.0.0.CR2 on Mac OS X 10.7.1 with HSQLDB 2.0.0
Reporter: Anton Korshunov
Priority: Critical
Attachments: jpa2-persistence.zip
Hi guys,
I've just tried to run an example from Mike Keith's Pro JPA 2 book and failed to do so due to a possible bug in Hibernate while loading a one-to-many collection containing entities, which primary key is a derived @Embeddable identifier, holding another (nested) @Embeddable identifier, as some fields of such identifiers are initialized with wrong values.
Here is what I've got:
@Embeddable
public class DeptId implements Serializable {
@Column(name = "CTRY")
private int country;
@Column(name = "NUM")
private int number;
..
}
@Embeddable
public class ProjectId implements Serializable {
@Embedded
private DeptId dept;
@Column(name = "P_NAME")
private String name;
...
}
@Entity
public class Project {
@MapsId("dept")
@ManyToOne
@JoinColumns({
@JoinColumn(name = "DEPT_NUM", referencedColumnName = "NUM",
updatable = false, insertable = false),
@JoinColumn(name = "DEPT_CTRY", referencedColumnName = "CTRY",
updatable = false, insertable = false)
})
private Department department;
@EmbeddedId
private ProjectId id;
...
}
@Entity
public class Department {
@EmbeddedId
private DeptId id;
@OneToMany(mappedBy = "department")
private List<Project> projects = new ArrayList<Project>();
...
public void addProject(final Project project) {
projects.add(project);
project.setDepartment(this);
}
}
And the test case:
final Department d1 = new Department(new DeptId(1, 44));
final Project p1 = new Project(new ProjectId(d1.getId(), "proj1"));
final Project p2 = new Project(new ProjectId(d1.getId(), "proj2"));
d1.addProject(p1);
d1.addProject(p2);
entityManager.persist(d1);
entityManager.persist(p1);
entityManager.persist(p2);
entityManager.flush();
entityManager.clear();
final List<Department> found = entityManager.createQuery(
"select d from Department d where id = :deptId", Department.class)
.setParameter("deptId", d1.getId())
.getResultList();
assertThat(found, is(not(nullValue())));
assertThat(found.size(), is(1));
assertThat(found.get(0).getProjects(), is(not(nullValue())));
assertThat(found.get(0).getProjects().size(), is(2));
for (final Project p : found.get(0).getProjects()) {
assertThat(p.getId().getDept().getCountry(), is(d1.getId().getCountry()));
assertThat(p.getId().getDept().getNumber(), is(d1.getId().getNumber()));
}
And it fails on this line:
assertThat(p.getId().getDept().getNumber(), is(d1.getId().getNumber()));
java.lang.AssertionError:
Expected: is <44>
got: <1>
<Click to see difference>
at org.junit.Assert.assertThat(Assert.java:750)
at org.junit.Assert.assertThat(Assert.java:709)
at jpa2.DeptProjTest.test1(DeptProjTest.java:75)
So all ProjectId#dept identifiers for the loaded collection items have been initialized to {1, 1} pair, that is the DeptId#number value have been initialized with the DeptId#country value, which is obviously wrong.
I've attached a Maven project with the entity classes, a JUnit test and a debug log, so you should be able to easily reproduce it, should it be a new bug rather than a known issue.
Thanks,
Anton
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-876) Extracted archetype does not compile
by Hardy Ferentschik (JIRA)
Extracted archetype does not compile
------------------------------------
Key: HSEARCH-876
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-876
Project: Hibernate Search
Issue Type: Bug
Components: build
Affects Versions: 3.4.1.Final
Reporter: Hardy Ferentschik
When getting the latest archetype:
{noformat}
mvn archetype:generate -DarchetypeGroupId=org.hibernate -DarchetypeArtifactId=hibernate-search-quickstart -DarchetypeVersion=3.4.1.Final -DarchetypeRepository=http://repository.jboss.org/nexus/content/groups/public-jboss/
{noformat}
and executing _mvn clean install_ after specifying the required information (using 1.0-SNAPSHOT as version), the following error occurs:
{noformat}
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hibernate Search Quickstart 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.hibernate:hibernate-search-analyzers:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.916s
[INFO] Finished at: Thu Aug 25 17:03:41 CEST 2011
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project bar: Could not resolve dependencies for project foo:bar:jar:1.0-SNAPSHOT: Failure to find org.hibernate:hibernate-search-analyzers:jar:1.0-SNAPSHOT in http://localhost:8082/nexus/content/groups/jboss-dev-group/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionExce...
{noformat}
I am not quite sure why _hibernate-search-analyzers_ in version _1.0-SNAPSHOT_ et requested. This feels like a maven bug. A fix is to explicitly add
{code}
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-analyzers</artifactId>
<version>${project.parent.version}</version>
</dependency>
{code}
to the archetype pom
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months