I sometimes need to use the Criteria in JPA, I don't know why, but the create query method not accept order with asc and desc in the same query, the Criteria support it, but damn, it's very hard, I don't know who think this codeParameterExpression age = qb.parameter(Integer.class);Predicate condition = qb.gt(p.get(Person_.age), age);c.where(condition);TypedQuery q = em.createQuery(c); List result = q.setParameter(age, 20).getResultList();is better than this oneString jpql = "select p from Person p where p.age > :age";Query query = em.createQuery(jpql).setParameter("age", 20);List result = query.getResultList();I don't need to map my class into another object called metamodel, one change in a model results into two changes, the model and the metamodel. Go to hell with de metamodel, we don't want, and don't need it, I write my queries using JPQL and don't want to use the Criteria API. Why they don't use the hibernate style? The code below isn't better?List cats = sess.createCriteria(Cat.class) .add( Restrictions.like("name", "Fritz%") ) .add( Restrictions.between("weight", minWeight, maxWeight) ) .list();Yes, I copy this codes from IBM and Hibernate:). Em portuguesI don't know why, nobody need it, I searched at the web, and I'm not found a solution for this, by the way, I implement my own solution.You can see some explain about the method here (in Pt-Br): http://www.arlindo-correia.com/140101.htmlBut, I converted the javascript code at http://www.profcardy.com/calculadoras/aplicativos.php?calc=4 to rubythe result is this monkey patchclass Time DAYS_OF_WEEK = [ :saturday, :sunday, :monday, :tuesday, :wednesday, :thursday, :friday ] def day_of_week day = self.day month = self.month year = self.year if month == 1 month = 13 year -= 1 end if month == 2 month = 14 year -= 1 end phase1 = ((month + 1)*3)/5 phase2 = (year/4) phase3 = (year/100) phase4 = (year/400) phase5 = day + (month*2)+phase1+year+phase2-phase3+phase4+2 phase6 = phase5/7 result = phase5-(phase6*7) DAYS_OF_WEEK[result] endendand some result by irb (I've used the rails console)irb(main):001:0> t = Time.now=> Wed Dec 15 22:05:00 -0200 2010irb(main):002:0> t.day_of_week=> :wednesdayirb(main):003:0> t.prev_month.day_of_week=> :mondayIf somebody know another way to do it, I'm listening I've watched the RailsCasts #281, and Ryan Bates is talking about the Foreman gem. At the first time I did not mind for the project, this is interesting, but I don't see how it's can be useful for me. Then I go back to the project when I'm working. I open my iTerm, an tab for mongod, and tab for spork, and a tab for guard, and another to run the generators.After I open all this tabs, Foreman gem cames to my mind. Well, I gave to Foreman a opportunity, and I loved it.If you think this scenario is the same of you, take a look at Foreman, and give to it a chance.You can add the gem to your Gemfile or install it by your own hand. To work foreman only needs a file called Procfile. in this manifest file, you name your process and tell to foreman what command they should use, and above a simple Procfile for the scenario: Very simple file, I've a process called mond, wich executes "sudo mongod" and starts the mongodb database, You'll see in the console, something like that "mongod.1