Skip to content

Commit a3c58ab

Browse files
committed
updated to 1.3.7
1 parent c3a7074 commit a3c58ab

File tree

18 files changed

+114
-52
lines changed

18 files changed

+114
-52
lines changed

.gradle/4.1/fileHashes/fileHashes.bin

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
68 Bytes
Binary file not shown.
1.61 KB
Binary file not shown.
913 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

.gradle/4.1/javaCompile/taskJars.bin

0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 70 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ allprojects {
1414
Add the dependency
1515
```
1616
dependencies {
17-
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.6'
17+
implementation 'com.github.p32929:AndroidEasySQL-Library:1.3.7'
1818
}
1919
```
2020

androideasysql-library/src/main/java/p32929/androideasysql_library/EasyDB.java

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public Cursor getOneRowData(int id) {
109109
allColNames[i + 1] = columns.get(i).columnName;
110110
}
111111
Cursor cursor = writableDatabase.query(TABLE_NAME,
112-
allColNames,
113-
allColNames[0].toString() + "=?",
112+
allColNames, allColNames[0].toString() + "=?",
114113
new String[]{String.valueOf(id)},
115114
null, null, null, "1");
116115

@@ -121,6 +120,45 @@ public Cursor getOneRowData(int id) {
121120
}
122121
}
123122

123+
public Cursor getOneRowData(int columnNumber, String value) {
124+
if (!initedDb || writableDatabase == null) initDatabase();
125+
String allColNames[] = new String[columns.size() + 1];
126+
allColNames[0] = "ID";
127+
for (int i = 0; i < columns.size(); i++) {
128+
allColNames[i + 1] = columns.get(i).columnName;
129+
}
130+
Cursor cursor = writableDatabase.query(TABLE_NAME,
131+
allColNames, allColNames[columnNumber].toString() + "=?",
132+
new String[]{value},
133+
null, null, null, "1");
134+
135+
if (cursor.getCount() > 0) {
136+
return cursor;
137+
} else {
138+
return null;
139+
}
140+
}
141+
142+
public Cursor getOneRowData(String columnName, String value) {
143+
if (!initedDb || writableDatabase == null) initDatabase();
144+
String allColNames[] = new String[columns.size() + 1];
145+
allColNames[0] = "ID";
146+
for (int i = 0; i < columns.size(); i++) {
147+
allColNames[i + 1] = columns.get(i).columnName;
148+
}
149+
Cursor cursor = writableDatabase.query(TABLE_NAME,
150+
allColNames, " " + columnName + " " + "=?",
151+
new String[]{value},
152+
null, null, null, "1");
153+
154+
if (cursor.getCount() > 0) {
155+
return cursor;
156+
} else {
157+
return null;
158+
}
159+
}
160+
161+
124162
public boolean matchColumns(String columnsToMatch[], String valuesToMatch[]) {
125163
String query = "";
126164
for (int i = 0; i < columnsToMatch.length; i++) {

app/src/main/java/p32929/databaseeasier/MainActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ private void showData() {
156156

157157
public void getData1(View view) {
158158
String tres = "";
159-
Cursor res = easyDB.getOneRowData(1);
159+
Cursor res = easyDB.getOneRowData(1, "5");
160160
if (res != null) {
161161
res.moveToFirst();
162162

build/android-profile/profile-2018-12-24-21-19-13-159.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Binary file not shown.

0 commit comments

Comments
 (0)