Bug 282 : Incorrect table alias with Multiple OneToOne on bean
Priority 
High
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.6.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
21/04/2010
Updated 
21/04/2010
Type 
Bug
 
Attachments 
No attachments

Testcase from Rien ... modified by Rob.

...
@Entity
public class OCar extends BasicDomain {

...

	@OneToOne(mappedBy="car",cascade=CascadeType.ALL)
	private OGearBox gearBox;

        @OneToOne(mappedBy="car",cascade=CascadeType.ALL)
        private OEngine engine;

...
 
Rob 21 Apr 07:46
The fix...

As per patch from Rien .. the fix is to DefaultDbSqlContext.popTableAlias() ... so set the currentPrefix back to null.

The current prefix is used to get a relative table alias for Reference beans and secondary properties.

Rob 21 Apr 07:46
Fixed in HEAD

fixed in HEAD.

woResponse

Upload a file