Why does @OrderBy add UPPER() to the ORDER BY clause? [message #730681] |
Wed, 28 September 2011 20:25 |
stephen.cross Messages: 2 Registered: September 2011 |
Junior Member |
|
|
Hi there. I hope I've got the right forum to ask this.
I'm using Toplink Essentials and the documentation states that if you add the @OrderBy annotation without any parameters it will use the primary key. When it produces the SQL for fetching the list Toplink Essentials wraps each field that is in my compound prmary key with UPPER() which my database (InterBase) doesn't support. Why and how can I stop it? As an alternative I tried specifying the fields in my primary key, eg.
@OrderBy("itemPK.jobNo, itemPK.itemNo")
and that doesn't work either.
Any advice? I'm getting desperate.
Here's a snippet of code:
@Entity
public class Job {
// ...
@OneToMany(cascade = CascadeType.ALL, mappedBy = "jobs")
@OrderBy
private List<Item> itemList;
// ...
}
@Embeddable
public class ItemPK {
@Column(name = "JOB_NO", nullable = false)
private int jobNo;
@Column(name = "ITEM_NO", nullable = false)
private int itemNo;
// ...
}
@Entity
public class Item {
// ...
@EmbeddedID
protected ItemPK itemPK;
// ...
@JoinColumn(name = "JOB_NO", referencedColumnName = "JOB_NO", insertable = false, updatable = false)
@ManyToOne
private Job job;
// ...
}
Regards,
Stephen.
|
|
|
Powered by
FUDForum. Page generated in 0.02809 seconds