Issue Details (XML | Word | Printable)

Key: HHH-3319
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Gregory Klimov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hibernate Core

@Where annotation is not processed with "Extra-lazy" loading

Created: 29/May/08 07:05 AM   Updated: 14/Apr/09 10:27 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Relates
 

Bug Testcase Reminder (view):
REMINDER: Bug reports should generally be accompanied by a test case
Participants: Gregory Klimov
Requires Release Note: Affirmative


 Description  « Hide

Consider code:

public class Transaction { ... @OneToMany @Fetch(FetchMode.SUBSELECT) @LazyCollection(LazyCollectionOption.EXTRA) @Where(clause = "entity=4") @JoinColumn(name = "entity_id") private List<Alert> alerts; ... }

public class Alert {
...
@Any(metaColumn = @Column(name = "entity"), fetch = FetchType.LAZY)
@AnyMetaDef(
idType = "long",
metaType = "integer",
metaValues = { @MetaValue(value = "4", targetEntity = Document.class), @MetaValue(value = "9", targetEntity = Transaction.class)})
@JoinColumn(name = "entity_id", insertable = false, updatable = false)
private Object relatedObject;
...
}

produces wrong SQL on size retrieval operation:
select
count(id)
from
alerts
where
entity_id =?



There are no comments yet on this issue.