Java N Coffee

Saturday, February 03, 2007

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.


Labels: , ,

2 Comments:

  • Bagge,
    Your blog is interesting. I was mistaken about Active Record implementations avaiable in Java. Although I do not have much experience with Ruby or PHP but from what I know, its gonna be slightly difficult in Java, though very much achieveable.
    Lets sit down this Monday and take it forward.

    By Blogger Sanket Sharma, At 2:01 PM  

  • Hi,

    this might be very interesting. I am fed up with the way java handles db connections...

    regards
    bill

    By Anonymous Anonymous, At 8:32 AM  

Post a Comment

Subscribe to Post Comments [Atom]



<< Home