Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-jams
Commits
ed4bf033
Commit
ed4bf033
authored
4 years ago
by
William Enright
Browse files
Options
Downloads
Patches
Plain Diff
Fixed search on local users being case sensitive
Change-Id: I6086e7a3472e4d168cb6395ecf46ada571818cad
parent
869e7901
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jams-common/src/main/java/net/jami/jams/common/dao/SelectStatementBuilder.java
+34
-34
34 additions, 34 deletions
...java/net/jami/jams/common/dao/SelectStatementBuilder.java
with
34 additions
and
34 deletions
jams-common/src/main/java/net/jami/jams/common/dao/SelectStatementBuilder.java
+
34
−
34
View file @
ed4bf033
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
* Copyright (C) 2020 by Savoir-faire Linux
* Authors: William Enright <william.enright@savoirfairelinux.com>
* Ndeye Anna Ndiaye <anna.ndiaye@savoirfairelinux.com>
* Johnny Flores <johnny.flores@savoirfairelinux.com>
* Mohammed Raza <mohammed.raza@savoirfairelinux.com>
* Felix Sidokhine <felix.sidokhine@savoirfairelinux.com>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package
net.jami.jams.common.dao
;
import
net.jami.jams.common.dao.connectivity.SQLConnection
;
...
...
@@ -29,8 +29,8 @@ import java.sql.PreparedStatement;
public
class
SelectStatementBuilder
{
public
static
PreparedStatement
buildStatement
(
String
table
,
StatementList
statementElements
,
StatementConstraints
statementConstraints
,
SQLConnection
connection
)
throws
Exception
StatementConstraints
statementConstraints
,
SQLConnection
connection
)
throws
Exception
{
PreparedStatement
ps
=
null
;
StringBuilder
stringBuilder
=
new
StringBuilder
();
...
...
@@ -38,27 +38,27 @@ public class SelectStatementBuilder {
if
(
statementElements
!=
null
)
{
stringBuilder
.
append
(
" WHERE "
);
for
(
StatementElement
statementElement
:
statementElements
.
getStatements
())
{
stringBuilder
.
append
(
statementElement
.
getColumn
())
.
append
(
" "
)
.
append
(
statementElement
.
getOperator
())
.
append
(
" "
)
.
append
(
"?"
)
.
append
(
" "
)
.
append
(
statementElement
.
getNextStatementRelation
())
.
append
(
" "
);
stringBuilder
.
append
(
"lower("
+
statementElement
.
getColumn
()
+
")"
)
.
append
(
" "
)
.
append
(
statementElement
.
getOperator
())
.
append
(
" "
)
.
append
(
"?"
)
.
append
(
" "
)
.
append
(
statementElement
.
getNextStatementRelation
())
.
append
(
" "
);
}
ps
=
connection
.
getConnection
().
prepareStatement
(
stringBuilder
.
toString
());
int
i
=
1
;
for
(
StatementElement
statementElement
:
statementElements
.
getStatements
())
{
ps
.
setString
(
i
,
statementElement
.
getValue
());
ps
.
setString
(
i
,
(
statementElement
.
getValue
())
.
toLowerCase
())
;
i
++;
}
}
else
{
if
(
statementConstraints
!=
null
){
stringBuilder
.
append
(
" LIMIT "
).
append
(
statementConstraints
.
getRowCount
())
.
append
(
" OFFSET "
).
append
(
statementConstraints
.
getOffset
());
.
append
(
" OFFSET "
).
append
(
statementConstraints
.
getOffset
());
}
ps
=
connection
.
getConnection
().
prepareStatement
(
stringBuilder
.
toString
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment