Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add static member `all` refers to "all rows" (note: ALL is an SQL key…

…word and thus is not never used as a column name)
  • Loading branch information...
commit 9cb40de2f19a75fafe60182c574bdd2da4d704b9 1 parent 470004e
@kazuho authored
View
5 net/examp1e/picoorm/example/Main.java
@@ -21,6 +21,11 @@ public static void main(String[] args) {
new Member().setName("tokuhirom").insert(conn);
new Member().setName("kazuho").insert(conn);
+ // SELECT FROM member;
+ for (Member m : Member.all.select(conn)) {
+ System.out.println(Long.toString(m.getId()) + ":" + m.getName());
+ }
+
// SELECT FROM member WHERE (name=?) OR (name=?)
for (Member m : Member.name.is("yappo").or(Member.name.is("tokuhirom")).orderBy(Member.id.asc).select(conn)) {
System.out.println(Long.toString(m.getId()) + ":" + m.getName());
View
2  net/examp1e/picoorm/example/Member.java
@@ -21,6 +21,8 @@ public Member createRow() {
return TABLE_DEFINITION;
}
+ public static Condition<Member> all = new Condition<Member>(TABLE_DEFINITION, "1");
+
public final static LongType.Predicate<Member> id = new LongType.Predicate<Member>().init(TABLE_DEFINITION, "id");
private LongType _id = new LongType().init(0L);
public Member setId(long id) {
Please sign in to comment.
Something went wrong with that request. Please try again.