Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Why does @OrderBy add UPPER() to the ORDER BY clause?
Why does @OrderBy add UPPER() to the ORDER BY clause? [message #730681] Wed, 28 September 2011 20:25
stephen.cross is currently offline stephen.crossFriend
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.
Previous Topic:How to use @XmlID and @XmlIDREF annotations on a entity defined by an interface
Next Topic:Problem JRE up to 6u18 on Java Web Start
Goto Forum:
  


Current Time: Sat Nov 29 01:50:10 GMT 2014

Powered by FUDForum. Page generated in 0.16687 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software