[Hibernate-JIRA] Created: (HHH-6915) Restrictions.ilike(String propertyValue, Object value) does not correctly initialize LikeExpresison
by Martin Kartumovich (JIRA)
Restrictions.ilike(String propertyValue, Object value) does not correctly initialize LikeExpresison
---------------------------------------------------------------------------------------------------
Key: HHH-6915
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6915
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 4.0.0.Final
Reporter: Martin Kartumovich
Priority: Minor
The method Restrictions.ilike(String propertyValue, Object value) uses the LikeExpression-Constructor LikeExpression(propertyName, value.toString()) which will initialize the LikeExpression with "ignoreCase = false".
The resulting SQL shows a normal "xyz like ?" instead of the expected "lower(xyz) like lower(?)" (i.e. Oracle10gDialect).
This issue seems to have been introduced with HHH-4943.
Workaround: Use Restrictions.ilike(String propertyValue, Object value, MatchMode mode). This will correctly initialize LikeExpression with "ignoreCase = true".
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HSEARCH-979) Programmatic API: mapping a composite primary key
by Fuessmann (JIRA)
Programmatic API: mapping a composite primary key
-------------------------------------------------
Key: HSEARCH-979
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-979
Project: Hibernate Search
Issue Type: Bug
Components: mapping
Affects Versions: 3.4.1.Final, 3.3.0.Final
Environment: Hibernate 3.6 Final
Reporter: Fuessmann
Hallo, I'm using Hibernate Search in combination with the [b]Programmatic API[/b] for dynamic indexing. Is there any possibility to index an entity with an composite primary key annotated with [b]@EmbeddedId[/b]. Using H.Search without the Programmatic API i choose a TwoWayFieldBridge but how can I use it with the Programmatic API?
In my case I am trying to implement a programmatic mapping for an entity. The entity has an an composite primary key annotated with @EmbeddedId.
{quote}
...
@Entity(name = "a")
@Table(name = "a")
public class A implements java.io.Serializable {
...
@EmbeddedId
@AttributeOverrides( {
@AttributeOverride(name = "name_1", column = @Column(name = "name_1", nullable = false, length = 64)),
@AttributeOverride(name = "name_2", column = @Column(name = "name_2", nullable = false, length = 16)) })
public AId getId() {
return this.id;
...
}
{quote}
Code for ABridge.class is not shown but still exists ..
I try a code like this, but the code does not work:
{quote}
mapping.entity(A.class).indexed().indexName("a")
.property("id", ElementType.METHOD).documentId().field().bridge(ABridge.class)
{quote}
Exception occurred during event dispatching:
{quote}
org.hibernate.HibernateException: [color=#FF0000]could not init listeners{color}
...
Caused by: org.hibernate.search.SearchException: {color:red} Unable to guess FieldBridge for id{color}
...
{quote}
I need an advise to solve my problem. Thanks
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months
[Hibernate-JIRA] Created: (HHH-7072) ElementCollection not updated correctly if the Embeddable component has a nullable property
by Aaron Trewern (JIRA)
ElementCollection not updated correctly if the Embeddable component has a nullable property
-------------------------------------------------------------------------------------------
Key: HHH-7072
URL: https://hibernate.onjira.com/browse/HHH-7072
Project: Hibernate ORM
Issue Type: Bug
Components: annotations
Affects Versions: 3.5.2
Reporter: Aaron Trewern
I have an @ElementCollection that is a collection of @Embeddable components. When saving an updated entity I can see that Hibernate issues an SQL DELETE for each of the rows in the collection followed by an INSERT, as is expected behaviour for an @ElementCollection.
The rows are deleted using a where clause that includes all the properties of the @Embeddabkle component. With MySQL the DELETE fails to delete any rows where the property is a nullable property and the previous value was null.
This is because Hibernate issues a prepared SQL ststement like "DELETE FROM tableName t where t.a = ? and t.b = ?" now if b is a nullable property and the component being saved has a null value for b then the delete will fail.
To correctly delete the row with MySQL the statement should be "DELETE FROM tableName t where t.a = ? and t.b is null"
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 9 months