Re: How to strip off selected columns from a criteria object

2010-05-21 Thread wzhao6...@gmail.com
Hi Thomas,

Thanks a lot, just tried this, worked like a charm.
BTW, Criteria object returned by criteria.clone() gets affected if the
original criteria object is modified. Is this a bug?
For examples, if I have an existing criteria, then I do:
Criteria criteriaClone = criteria.clone();
criteria.getSelectColumns().clean();

both criteria and criteriaClone have empty selectcolumn list.
Thanks,



David

On Mon, May 10, 2010 at 1:02 PM, Thomas Vandahl t...@apache.org wrote:

 Hi Dave,

 wzhao6...@gmail.com schrieb:

  Thanks for your reply. But what I need to deal with is that:
 I have a criteria object, with joins, and where clauses and a list of
 columns to select, and I need to remove all the selected columns in the
 criteria, both selected column, and as columns, so I can use OMPeer class
 to
 select a list of OM objects;


 What happens if you do criteria.getSelectColumns().clear() or
 criteria.getAsColumns().clear(), respectively? Would that help?
 (This is what is basically done in criteria.clear(), among other things)


 Bye, Thomas.

 -
 To unsubscribe, e-mail: torque-user-unsubscr...@db.apache.org
 For additional commands, e-mail: torque-user-h...@db.apache.org




how to contruct an object extending com.workingdogs.village.Record from a Record

2010-05-21 Thread wzhao6...@gmail.com
Hi there,

I need to create a class, say BetterRecord, that extends
com.workingdogs.village.Record. I couldn't figure out how to construct a
BetterRecord object from an existing com.workingdogs.village.Record.

public class BetterRecordextends Record {
   public RetterRecord (Record r) {
  ???
   }
 public String getThings() {
  return this.things;
 }
 public void setThings(String str) {
  this.things = str;
 }
}

Thanks very much!

David