Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sorma: add more helper functions #219

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions src/main/java/com/zoffcc/applications/sorm/FileDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,14 @@ public FileDB idLt(long id)
return this;
}

public FileDB idLe(long id)
{
this.sql_where = this.sql_where + " and id<=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Long, id));
bind_where_count++;
return this;
}

public FileDB idGt(long id)
{
this.sql_where = this.sql_where + " and id>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -531,6 +539,14 @@ public FileDB idGt(long id)
return this;
}

public FileDB idGe(long id)
{
this.sql_where = this.sql_where + " and id>=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Long, id));
bind_where_count++;
return this;
}

public FileDB idBetween(long id1, long id2)
{
this.sql_where = this.sql_where + " and id>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " and id<?" + (BINDVAR_OFFSET_WHERE + 1 + bind_where_count) + " ";
Expand Down Expand Up @@ -565,6 +581,14 @@ public FileDB kindLt(int kind)
return this;
}

public FileDB kindLe(int kind)
{
this.sql_where = this.sql_where + " and kind<=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Int, kind));
bind_where_count++;
return this;
}

public FileDB kindGt(int kind)
{
this.sql_where = this.sql_where + " and kind>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -573,6 +597,14 @@ public FileDB kindGt(int kind)
return this;
}

public FileDB kindGe(int kind)
{
this.sql_where = this.sql_where + " and kind>=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Int, kind));
bind_where_count++;
return this;
}

public FileDB kindBetween(int kind1, int kind2)
{
this.sql_where = this.sql_where + " and kind>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " and kind<?" + (BINDVAR_OFFSET_WHERE + 1 + bind_where_count) + " ";
Expand Down Expand Up @@ -607,6 +639,14 @@ public FileDB directionLt(int direction)
return this;
}

public FileDB directionLe(int direction)
{
this.sql_where = this.sql_where + " and direction<=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Int, direction));
bind_where_count++;
return this;
}

public FileDB directionGt(int direction)
{
this.sql_where = this.sql_where + " and direction>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -615,6 +655,14 @@ public FileDB directionGt(int direction)
return this;
}

public FileDB directionGe(int direction)
{
this.sql_where = this.sql_where + " and direction>=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Int, direction));
bind_where_count++;
return this;
}

public FileDB directionBetween(int direction1, int direction2)
{
this.sql_where = this.sql_where + " and direction>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " and direction<?" + (BINDVAR_OFFSET_WHERE + 1 + bind_where_count) + " ";
Expand All @@ -641,6 +689,22 @@ public FileDB tox_public_key_stringNotEq(String tox_public_key_string)
return this;
}

public FileDB tox_public_key_stringLike(String tox_public_key_string)
{
this.sql_where = this.sql_where + " and tox_public_key_string LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, tox_public_key_string));
bind_where_count++;
return this;
}

public FileDB tox_public_key_stringNotLike(String tox_public_key_string)
{
this.sql_where = this.sql_where + " and tox_public_key_string NOT LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, tox_public_key_string));
bind_where_count++;
return this;
}

public FileDB path_nameEq(String path_name)
{
this.sql_where = this.sql_where + " and path_name=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -657,6 +721,22 @@ public FileDB path_nameNotEq(String path_name)
return this;
}

public FileDB path_nameLike(String path_name)
{
this.sql_where = this.sql_where + " and path_name LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, path_name));
bind_where_count++;
return this;
}

public FileDB path_nameNotLike(String path_name)
{
this.sql_where = this.sql_where + " and path_name NOT LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, path_name));
bind_where_count++;
return this;
}

public FileDB file_nameEq(String file_name)
{
this.sql_where = this.sql_where + " and file_name=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -673,6 +753,22 @@ public FileDB file_nameNotEq(String file_name)
return this;
}

public FileDB file_nameLike(String file_name)
{
this.sql_where = this.sql_where + " and file_name LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, file_name));
bind_where_count++;
return this;
}

public FileDB file_nameNotLike(String file_name)
{
this.sql_where = this.sql_where + " and file_name NOT LIKE ?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ESCAPE '\\' ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_String, file_name));
bind_where_count++;
return this;
}

public FileDB filesizeEq(long filesize)
{
this.sql_where = this.sql_where + " and filesize=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -697,6 +793,14 @@ public FileDB filesizeLt(long filesize)
return this;
}

public FileDB filesizeLe(long filesize)
{
this.sql_where = this.sql_where + " and filesize<=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Long, filesize));
bind_where_count++;
return this;
}

public FileDB filesizeGt(long filesize)
{
this.sql_where = this.sql_where + " and filesize>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
Expand All @@ -705,6 +809,14 @@ public FileDB filesizeGt(long filesize)
return this;
}

public FileDB filesizeGe(long filesize)
{
this.sql_where = this.sql_where + " and filesize>=?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " ";
bind_where_vars.add(new OrmaBindvar(BINDVAR_TYPE_Long, filesize));
bind_where_count++;
return this;
}

public FileDB filesizeBetween(long filesize1, long filesize2)
{
this.sql_where = this.sql_where + " and filesize>?" + (BINDVAR_OFFSET_WHERE + bind_where_count) + " and filesize<?" + (BINDVAR_OFFSET_WHERE + 1 + bind_where_count) + " ";
Expand Down
Loading
Loading