Active Record Java - II
Did few more things
Going at slow pace :) right now
Well I have added few methods.....
find_all("parent","condition:class= ? and name = ?,limit:0..10","3","cool dude")
this method will give me ArrayList of Objects of Class Parent which maps to parent table and where class is 3 ,name is "cool dude" and will limit the resultset to top 10.
a variant of the above
find_all("parent","limit:0..10,condition:class= ?,order:? desc","1","name")
here i have brought limit ahead of condition and also we can have order by.
find_all("parent")
this method will give me list of all the rows in table parent.
Though working on creates I have accomplished so far.......
Parent p = new Parent();
p.set("id",1);
p.set("name", "John");
p.set("address", "Pune");
p.set("class", 3);
p.save();
will create a new row with above details.
these are the few things I have accomplished lately.
Going at slow pace :) right now
Well I have added few methods.....
find_all("parent","condition:class= ? and name = ?,limit:0..10","3","cool dude")
this method will give me ArrayList of Objects of Class Parent which maps to parent table and where class is 3 ,name is "cool dude" and will limit the resultset to top 10.
a variant of the above
find_all("parent","limit:0..10,condition:class= ?,order:? desc","1","name")
here i have brought limit ahead of condition and also we can have order by.
find_all("parent")
this method will give me list of all the rows in table parent.
Though working on creates I have accomplished so far.......
Parent p = new Parent();
p.set("id",1);
p.set("name", "John");
p.set("address", "Pune");
p.set("class", 3);
p.save();
will create a new row with above details.
these are the few things I have accomplished lately.
Labels: activerecord, java, orm