111 lines
2.8 KiB
Java
111 lines
2.8 KiB
Java
package org.greenrobot.greendao.internal;
|
|
|
|
import org.greenrobot.greendao.database.Database;
|
|
import org.greenrobot.greendao.database.DatabaseStatement;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class TableStatements {
|
|
private final Database a;
|
|
private final String b;
|
|
private final String[] c;
|
|
private final String[] d;
|
|
private DatabaseStatement e;
|
|
private DatabaseStatement f;
|
|
private DatabaseStatement g;
|
|
private DatabaseStatement h;
|
|
private volatile String i;
|
|
private volatile String j;
|
|
private volatile String k;
|
|
|
|
public TableStatements(Database database, String str, String[] strArr, String[] strArr2) {
|
|
this.a = database;
|
|
this.b = str;
|
|
this.c = strArr;
|
|
this.d = strArr2;
|
|
}
|
|
|
|
public DatabaseStatement a() {
|
|
if (this.h == null) {
|
|
DatabaseStatement b = this.a.b(SqlUtils.a(this.b, this.d));
|
|
synchronized (this) {
|
|
if (this.h == null) {
|
|
this.h = b;
|
|
}
|
|
}
|
|
if (this.h != b) {
|
|
b.close();
|
|
}
|
|
}
|
|
return this.h;
|
|
}
|
|
|
|
public DatabaseStatement b() {
|
|
if (this.f == null) {
|
|
DatabaseStatement b = this.a.b(SqlUtils.a("INSERT OR REPLACE INTO ", this.b, this.c));
|
|
synchronized (this) {
|
|
if (this.f == null) {
|
|
this.f = b;
|
|
}
|
|
}
|
|
if (this.f != b) {
|
|
b.close();
|
|
}
|
|
}
|
|
return this.f;
|
|
}
|
|
|
|
public DatabaseStatement c() {
|
|
if (this.e == null) {
|
|
DatabaseStatement b = this.a.b(SqlUtils.a("INSERT INTO ", this.b, this.c));
|
|
synchronized (this) {
|
|
if (this.e == null) {
|
|
this.e = b;
|
|
}
|
|
}
|
|
if (this.e != b) {
|
|
b.close();
|
|
}
|
|
}
|
|
return this.e;
|
|
}
|
|
|
|
public String d() {
|
|
if (this.i == null) {
|
|
this.i = SqlUtils.a(this.b, "T", this.c, false);
|
|
}
|
|
return this.i;
|
|
}
|
|
|
|
public String e() {
|
|
if (this.j == null) {
|
|
StringBuilder sb = new StringBuilder(d());
|
|
sb.append("WHERE ");
|
|
SqlUtils.b(sb, "T", this.d);
|
|
this.j = sb.toString();
|
|
}
|
|
return this.j;
|
|
}
|
|
|
|
public String f() {
|
|
if (this.k == null) {
|
|
this.k = d() + "WHERE ROWID=?";
|
|
}
|
|
return this.k;
|
|
}
|
|
|
|
public DatabaseStatement g() {
|
|
if (this.g == null) {
|
|
DatabaseStatement b = this.a.b(SqlUtils.a(this.b, this.c, this.d));
|
|
synchronized (this) {
|
|
if (this.g == null) {
|
|
this.g = b;
|
|
}
|
|
}
|
|
if (this.g != b) {
|
|
b.close();
|
|
}
|
|
}
|
|
return this.g;
|
|
}
|
|
}
|