I am trying to get Doctrine2 Entities, ordered by their ID which apparently is a String even though it contains only Numbers.
So what I would like to do is something like this:

SELECT entity1, cast (entity1.id AS integer) AS orderId
FROM Namespace\Bla\MyEntity 
ORDER BY orderId


Is there a way to do something like this in Doctrine2?
Or, what would be the best practise to get my Result if i can't change the type of the id (due to customer requirements of course)?



Attention: I am not asking SQL Code, i am asking for a Doctrine2 Solution, preferably in DQL


Question: How to fix a Macbook Pro trackpad where the mouse pointer is randomly moving?
Answer: This was driving me crazy, too. It just started happening yesterday, but was dangerous as the cursor kept selecting everything--making selection rectangles especially on the desktop, opening programs I didn't want to open on the dock, and generally jumping around like a drunk rabbit. 

Searched forums, read about others saying this happened to them after updating their Mac software, etc., etc. Got so frustrated I literally slapped the trackpad with my open palm. And what do you know--that fixed it. Now my trackpad is working perfectly again. Must have been something pinching or pressing against the underside of the trackpad. 

Don't know if you're all going to believe me 'cause it sounds ridiculous, and if you do believe me I don't know if you're willing to do it. But I swear on my soul it's true and I'm posting this solution for all to see because I want to help.