SingleSQLiteImpl.smali

.class public final Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;
.super Lcom/litesuits/orm/LiteOrm;
.source "SingleSQLiteImpl.java"


# static fields
.field public static final TAG:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .line 24
    const-class v0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->TAG:Ljava/lang/String;

    return-void
.end method

.method protected constructor <init>(Lcom/litesuits/orm/LiteOrm;)V
    .registers 2
    .param p1, "dataBase"    # Lcom/litesuits/orm/LiteOrm;

    .line 27
    invoke-direct {p0, p1}, Lcom/litesuits/orm/LiteOrm;-><init>(Lcom/litesuits/orm/LiteOrm;)V

    .line 28
    return-void
.end method

.method private constructor <init>(Lcom/litesuits/orm/db/DataBaseConfig;)V
    .registers 2
    .param p1, "config"    # Lcom/litesuits/orm/db/DataBaseConfig;

    .line 31
    invoke-direct {p0, p1}, Lcom/litesuits/orm/LiteOrm;-><init>(Lcom/litesuits/orm/db/DataBaseConfig;)V

    .line 32
    return-void
.end method

.method public static declared-synchronized newInstance(Lcom/litesuits/orm/db/DataBaseConfig;)Lcom/litesuits/orm/LiteOrm;
    .registers 3
    .param p0, "config"    # Lcom/litesuits/orm/db/DataBaseConfig;

    const-class v0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;

    monitor-enter v0

    .line 36
    :try_start_3
    new-instance v1, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;

    invoke-direct {v1, p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;-><init>(Lcom/litesuits/orm/db/DataBaseConfig;)V
    :try_end_8
    .catchall {:try_start_3 .. :try_end_8} :catchall_a

    monitor-exit v0

    return-object v1

    .end local p0    # "config":Lcom/litesuits/orm/db/DataBaseConfig;
    :catchall_a
    move-exception p0

    monitor-exit v0

    throw p0
.end method


# virtual methods
.method public cascade()Lcom/litesuits/orm/LiteOrm;
    .registers 2

    .line 46
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->otherDatabase:Lcom/litesuits/orm/LiteOrm;

    if-nez v0, :cond_b

    .line 47
    new-instance v0, Lcom/litesuits/orm/db/impl/CascadeSQLiteImpl;

    invoke-direct {v0, p0}, Lcom/litesuits/orm/db/impl/CascadeSQLiteImpl;-><init>(Lcom/litesuits/orm/LiteOrm;)V

    iput-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->otherDatabase:Lcom/litesuits/orm/LiteOrm;

    .line 49
    :cond_b
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->otherDatabase:Lcom/litesuits/orm/LiteOrm;

    return-object v0
.end method

.method public delete(Lcom/litesuits/orm/db/assit/WhereBuilder;)I
    .registers 5
    .param p1, "where"    # Lcom/litesuits/orm/db/assit/WhereBuilder;

    .line 245
    invoke-virtual {p1}, Lcom/litesuits/orm/db/assit/WhereBuilder;->getTableClass()Ljava/lang/Class;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Class;Z)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 246
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_36

    .line 247
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 249
    :try_start_16
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v1}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 250
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-virtual {p1}, Lcom/litesuits/orm/db/assit/WhereBuilder;->createStatementDelete()Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    invoke-virtual {v2, v1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execDelete(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v2
    :try_end_24
    .catch Ljava/lang/Exception; {:try_start_16 .. :try_end_24} :catch_2a
    .catchall {:try_start_16 .. :try_end_24} :catchall_28

    .line 254
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v2

    .end local v1    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catchall_28
    move-exception v1

    goto :goto_32

    .line 251
    :catch_2a
    move-exception v1

    .line 252
    .local v1, "e":Ljava/lang/Exception;
    :try_start_2b
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2e
    .catchall {:try_start_2b .. :try_end_2e} :catchall_28

    .line 254
    .end local v1    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 255
    goto :goto_36

    .line 254
    :goto_32
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v1

    .line 257
    :cond_36
    :goto_36
    const/4 v1, -0x1

    return v1
.end method

.method public delete(Ljava/lang/Class;)I
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class<",
            "TT;>;)I"
        }
    .end annotation

    .line 203
    .local p1, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    invoke-virtual {p0, p1}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->deleteAll(Ljava/lang/Class;)I

    move-result v0

    return v0
.end method

.method public delete(Ljava/lang/Class;JJLjava/lang/String;)I
    .registers 14
    .param p2, "start"    # J
    .param p4, "end"    # J
    .param p6, "orderAscColumn"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class<",
            "TT;>;JJ",
            "Ljava/lang/String;",
            ")I"
        }
    .end annotation

    .line 283
    .local p1, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    const/4 v0, 0x0

    invoke-static {p1, v0}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Class;Z)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 284
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_64

    .line 285
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 287
    const-wide/16 v1, 0x0

    cmp-long v3, p2, v1

    if-ltz v3, :cond_47

    cmp-long v3, p4, p2

    if-ltz v3, :cond_47

    .line 288
    cmp-long v3, p2, v1

    if-eqz v3, :cond_23

    .line 289
    const-wide/16 v1, 0x1

    sub-long/2addr p2, v1

    .line 291
    :cond_23
    const-wide/32 v1, 0x7fffffff

    cmp-long v3, p4, v1

    if-nez v3, :cond_2d

    const-wide/16 v1, -0x1

    goto :goto_2f

    :cond_2d
    sub-long v1, p4, p2

    :goto_2f
    move-wide v4, v1

    .line 292
    .end local p4    # "end":J
    .local v4, "end":J
    move-object v1, p1

    move-wide v2, p2

    move-object v6, p6

    :try_start_33
    invoke-static/range {v1 .. v6}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildDeleteSql(Ljava/lang/Class;JJLjava/lang/String;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object p4

    .line 293
    .local p4, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    iget-object p5, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {p5}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object p5

    .line 294
    .local p5, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-virtual {p4, p5}, Lcom/litesuits/orm/db/assit/SQLStatement;->execDelete(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v1
    :try_end_41
    .catch Ljava/lang/Exception; {:try_start_33 .. :try_end_41} :catch_45
    .catchall {:try_start_33 .. :try_end_41} :catchall_5f

    .line 298
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v1

    .line 295
    .end local p4    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    .end local p5    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catch_45
    move-exception p4

    goto :goto_57

    .line 287
    .end local v4    # "end":J
    .local p4, "end":J
    :cond_47
    :try_start_47
    new-instance v1, Ljava/lang/RuntimeException;

    const-string/jumbo v2, "start must >=0 and smaller than end"

    invoke-direct {v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    .end local v0    # "table":Lcom/litesuits/orm/db/model/EntityTable;
    .end local p1    # "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    .end local p2    # "start":J
    .end local p4    # "end":J
    .end local p6    # "orderAscColumn":Ljava/lang/String;
    throw v1
    :try_end_50
    .catch Ljava/lang/Exception; {:try_start_47 .. :try_end_50} :catch_54
    .catchall {:try_start_47 .. :try_end_50} :catchall_50

    .line 298
    .restart local v0    # "table":Lcom/litesuits/orm/db/model/EntityTable;
    .restart local p1    # "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    .restart local p2    # "start":J
    .restart local p4    # "end":J
    .restart local p6    # "orderAscColumn":Ljava/lang/String;
    :catchall_50
    move-exception v1

    move-wide v4, p4

    move-object p4, v1

    goto :goto_60

    .line 295
    :catch_54
    move-exception v1

    move-wide v4, p4

    move-object p4, v1

    .line 296
    .restart local v4    # "end":J
    .local p4, "e":Ljava/lang/Exception;
    :goto_57
    :try_start_57
    invoke-virtual {p4}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_5a
    .catchall {:try_start_57 .. :try_end_5a} :catchall_5f

    .line 298
    .end local p4    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 299
    move-wide p4, v4

    goto :goto_64

    .line 298
    :catchall_5f
    move-exception p4

    :goto_60
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw p4

    .line 301
    .end local v4    # "end":J
    .local p4, "end":J
    :cond_64
    :goto_64
    const/4 v1, -0x1

    return v1
.end method

.method public delete(Ljava/lang/Class;Lcom/litesuits/orm/db/assit/WhereBuilder;)I
    .registers 4
    .param p2, "where"    # Lcom/litesuits/orm/db/assit/WhereBuilder;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class<",
            "TT;>;",
            "Lcom/litesuits/orm/db/assit/WhereBuilder;",
            ")I"
        }
    .end annotation

    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .line 240
    .local p1, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    invoke-virtual {p0, p2}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->delete(Lcom/litesuits/orm/db/assit/WhereBuilder;)I

    move-result v0

    return v0
.end method

.method public delete(Ljava/lang/Object;)I
    .registers 5
    .param p1, "entity"    # Ljava/lang/Object;

    .line 186
    invoke-static {p1}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 187
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_31

    .line 188
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 190
    :try_start_11
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v1}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 191
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildDeleteSql(Ljava/lang/Object;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    invoke-virtual {v2, v1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execDelete(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v2
    :try_end_1f
    .catch Ljava/lang/Exception; {:try_start_11 .. :try_end_1f} :catch_25
    .catchall {:try_start_11 .. :try_end_1f} :catchall_23

    .line 195
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v2

    .end local v1    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catchall_23
    move-exception v1

    goto :goto_2d

    .line 192
    :catch_25
    move-exception v1

    .line 193
    .local v1, "e":Ljava/lang/Exception;
    :try_start_26
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_29
    .catchall {:try_start_26 .. :try_end_29} :catchall_23

    .line 195
    .end local v1    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 196
    goto :goto_31

    .line 195
    :goto_2d
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v1

    .line 198
    :cond_31
    :goto_31
    const/4 v1, -0x1

    return v1
.end method

.method public delete(Ljava/util/Collection;)I
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;)I"
        }
    .end annotation

    .line 208
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 210
    :try_start_3
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/Checker;->isEmpty(Ljava/util/Collection;)Z

    move-result v0

    if-nez v0, :cond_4a

    .line 211
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    invoke-static {v0}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 212
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_4a

    .line 214
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v1}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 215
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_28
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_28} :catch_50
    .catchall {:try_start_3 .. :try_end_28} :catchall_4e

    .line 217
    const/16 v2, 0x3e7

    const/4 v3, 0x0

    :try_start_2b
    new-instance v4, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl$1;

    invoke-direct {v4, p0, v1}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl$1;-><init>(Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;Landroid/database/sqlite/SQLiteDatabase;)V

    invoke-static {p1, v2, v4}, Lcom/litesuits/orm/db/assit/CollSpliter;->split(Ljava/util/Collection;ILcom/litesuits/orm/db/assit/CollSpliter$Spliter;)I

    move-result v2
    :try_end_34
    .catchall {:try_start_2b .. :try_end_34} :catchall_42

    .line 222
    .local v2, "rows":I
    :try_start_34
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_37
    .catchall {:try_start_34 .. :try_end_37} :catchall_40

    .line 224
    :try_start_37
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V
    :try_end_3a
    .catch Ljava/lang/Exception; {:try_start_37 .. :try_end_3a} :catch_50
    .catchall {:try_start_37 .. :try_end_3a} :catchall_4e

    .line 225
    nop

    .line 226
    nop

    .line 232
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v2

    .line 224
    :catchall_40
    move-exception v3

    goto :goto_46

    .end local v2    # "rows":I
    :catchall_42
    move-exception v2

    move v5, v3

    move-object v3, v2

    move v2, v5

    .restart local v2    # "rows":I
    :goto_46
    :try_start_46
    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .end local p1    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    throw v3
    :try_end_4a
    .catch Ljava/lang/Exception; {:try_start_46 .. :try_end_4a} :catch_50
    .catchall {:try_start_46 .. :try_end_4a} :catchall_4e

    .line 232
    .end local v0    # "table":Lcom/litesuits/orm/db/model/EntityTable;
    .end local v1    # "db":Landroid/database/sqlite/SQLiteDatabase;
    .end local v2    # "rows":I
    .restart local p1    # "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    :cond_4a
    :goto_4a
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 233
    goto :goto_55

    .line 232
    :catchall_4e
    move-exception v0

    goto :goto_57

    .line 229
    :catch_50
    move-exception v0

    .line 230
    .local v0, "e":Ljava/lang/Exception;
    :try_start_51
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_54
    .catchall {:try_start_51 .. :try_end_54} :catchall_4e

    .end local v0    # "e":Ljava/lang/Exception;
    goto :goto_4a

    .line 234
    :goto_55
    const/4 v0, -0x1

    return v0

    .line 232
    :goto_57
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    goto :goto_5c

    :goto_5b
    throw v0

    :goto_5c
    goto :goto_5b
.end method

.method public deleteAll(Ljava/lang/Class;)I
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class<",
            "TT;>;)I"
        }
    .end annotation

    .line 262
    .local p1, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    const/4 v0, 0x0

    invoke-static {p1, v0}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Class;Z)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 263
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_32

    .line 264
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 266
    :try_start_12
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v1}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    .line 267
    .local v1, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildDeleteAllSql(Ljava/lang/Class;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    .line 268
    .local v2, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    invoke-virtual {v2, v1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execDelete(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v3
    :try_end_20
    .catch Ljava/lang/Exception; {:try_start_12 .. :try_end_20} :catch_26
    .catchall {:try_start_12 .. :try_end_20} :catchall_24

    .line 272
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v3

    .end local v1    # "db":Landroid/database/sqlite/SQLiteDatabase;
    .end local v2    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    :catchall_24
    move-exception v1

    goto :goto_2e

    .line 269
    :catch_26
    move-exception v1

    .line 270
    .local v1, "e":Ljava/lang/Exception;
    :try_start_27
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2a
    .catchall {:try_start_27 .. :try_end_2a} :catchall_24

    .line 272
    .end local v1    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 273
    goto :goto_32

    .line 272
    :goto_2e
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v1

    .line 275
    :cond_32
    :goto_32
    const/4 v1, -0x1

    return v1
.end method

.method public insert(Ljava/util/Collection;)I
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;)I"
        }
    .end annotation

    .line 108
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->insert(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I

    move-result v0

    return v0
.end method

.method public insert(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I
    .registers 7
    .param p2, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;",
            "Lcom/litesuits/orm/db/model/ConflictAlgorithm;",
            ")I"
        }
    .end annotation

    .line 113
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 115
    :try_start_3
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/Checker;->isEmpty(Ljava/util/Collection;)Z

    move-result v0

    if-nez v0, :cond_28

    .line 116
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 117
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .line 118
    .local v1, "entity":Ljava/lang/Object;
    invoke-static {v1, p2}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildInsertAllSql(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    .line 119
    .local v2, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    iget-object v3, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v3, v0, v1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 120
    invoke-virtual {v2, v0, p1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execInsertCollection(Landroid/database/sqlite/SQLiteDatabase;Ljava/util/Collection;)I

    move-result v3
    :try_end_24
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_24} :catch_2e
    .catchall {:try_start_3 .. :try_end_24} :catchall_2c

    .line 125
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v3

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    .end local v1    # "entity":Ljava/lang/Object;
    .end local v2    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    :cond_28
    :goto_28
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 126
    goto :goto_33

    .line 125
    :catchall_2c
    move-exception v0

    goto :goto_35

    .line 122
    :catch_2e
    move-exception v0

    .line 123
    .local v0, "e":Ljava/lang/Exception;
    :try_start_2f
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_32
    .catchall {:try_start_2f .. :try_end_32} :catchall_2c

    .end local v0    # "e":Ljava/lang/Exception;
    goto :goto_28

    .line 127
    :goto_33
    const/4 v0, -0x1

    return v0

    .line 125
    :goto_35
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    goto :goto_3a

    :goto_39
    throw v0

    :goto_3a
    goto :goto_39
.end method

.method public insert(Ljava/lang/Object;)J
    .registers 4
    .param p1, "entity"    # Ljava/lang/Object;

    .line 88
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->insert(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)J

    move-result-wide v0

    return-wide v0
.end method

.method public insert(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)J
    .registers 6
    .param p1, "entity"    # Ljava/lang/Object;
    .param p2, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;

    .line 93
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 95
    :try_start_3
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 96
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v1, v0, p1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 97
    invoke-static {p1, p2}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildInsertSql(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v1

    invoke-virtual {v1, v0, p1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execInsert(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)J

    move-result-wide v1
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_16} :catch_1c
    .catchall {:try_start_3 .. :try_end_16} :catchall_1a

    .line 101
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return-wide v1

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catchall_1a
    move-exception v0

    goto :goto_27

    .line 98
    :catch_1c
    move-exception v0

    .line 99
    .local v0, "e":Ljava/lang/Exception;
    :try_start_1d
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_20
    .catchall {:try_start_1d .. :try_end_20} :catchall_1a

    .line 101
    .end local v0    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 102
    nop

    .line 103
    const-wide/16 v0, -0x1

    return-wide v0

    .line 101
    :goto_27
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v0
.end method

.method public query(Lcom/litesuits/orm/db/assit/QueryBuilder;)Ljava/util/ArrayList;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/litesuits/orm/db/assit/QueryBuilder<",
            "TT;>;)",
            "Ljava/util/ArrayList<",
            "TT;>;"
        }
    .end annotation

    .line 311
    .local p1, "qb":Lcom/litesuits/orm/db/assit/QueryBuilder;, "Lcom/litesuits/orm/db/assit/QueryBuilder<TT;>;"
    invoke-virtual {p1}, Lcom/litesuits/orm/db/assit/QueryBuilder;->getQueryClass()Ljava/lang/Class;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Class;Z)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v0

    .line 312
    .local v0, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v2, v0, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_31

    .line 313
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 315
    :try_start_16
    invoke-virtual {p1}, Lcom/litesuits/orm/db/assit/QueryBuilder;->createStatement()Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v1

    iget-object v2, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v2}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v2

    invoke-virtual {p1}, Lcom/litesuits/orm/db/assit/QueryBuilder;->getQueryClass()Ljava/lang/Class;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Lcom/litesuits/orm/db/assit/SQLStatement;->query(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Class;)Ljava/util/ArrayList;

    move-result-object v1
    :try_end_28
    .catchall {:try_start_16 .. :try_end_28} :catchall_2c

    .line 317
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return-object v1

    :catchall_2c
    move-exception v1

    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v1

    .line 320
    :cond_31
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    return-object v1
.end method

.method public query(Ljava/lang/Class;)Ljava/util/ArrayList;
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/Class<",
            "TT;>;)",
            "Ljava/util/ArrayList<",
            "TT;>;"
        }
    .end annotation

    .line 306
    .local p1, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    new-instance v0, Lcom/litesuits/orm/db/assit/QueryBuilder;

    invoke-direct {v0, p1}, Lcom/litesuits/orm/db/assit/QueryBuilder;-><init>(Ljava/lang/Class;)V

    invoke-virtual {p0, v0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->query(Lcom/litesuits/orm/db/assit/QueryBuilder;)Ljava/util/ArrayList;

    move-result-object v0

    return-object v0
.end method

.method public queryById(JLjava/lang/Class;)Ljava/lang/Object;
    .registers 5
    .param p1, "id"    # J
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(J",
            "Ljava/lang/Class<",
            "TT;>;)TT;"
        }
    .end annotation

    .line 326
    .local p3, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    invoke-static {p1, p2}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0, p3}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->queryById(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public queryById(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
    .registers 8
    .param p1, "id"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/lang/String;",
            "Ljava/lang/Class<",
            "TT;>;)TT;"
        }
    .end annotation

    .line 331
    .local p2, "claxx":Ljava/lang/Class;, "Ljava/lang/Class<TT;>;"
    const/4 v0, 0x0

    invoke-static {p2, v0}, Lcom/litesuits/orm/db/TableManager;->getTable(Ljava/lang/Class;Z)Lcom/litesuits/orm/db/model/EntityTable;

    move-result-object v1

    .line 332
    .local v1, "table":Lcom/litesuits/orm/db/model/EntityTable;
    iget-object v2, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    iget-object v3, v1, Lcom/litesuits/orm/db/model/EntityTable;->name:Ljava/lang/String;

    invoke-virtual {v2, v3}, Lcom/litesuits/orm/db/TableManager;->isSQLTableCreated(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_5a

    .line 333
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 335
    :try_start_12
    new-instance v2, Lcom/litesuits/orm/db/assit/QueryBuilder;

    invoke-direct {v2, p2}, Lcom/litesuits/orm/db/assit/QueryBuilder;-><init>(Ljava/lang/Class;)V

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v4, v1, Lcom/litesuits/orm/db/model/EntityTable;->key:Lcom/litesuits/orm/db/model/Primarykey;

    iget-object v4, v4, Lcom/litesuits/orm/db/model/Primarykey;->column:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v4, "=?"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/String;

    aput-object p1, v4, v0

    invoke-virtual {v2, v3, v4}, Lcom/litesuits/orm/db/assit/QueryBuilder;->where(Ljava/lang/String;[Ljava/lang/Object;)Lcom/litesuits/orm/db/assit/QueryBuilder;

    move-result-object v2

    invoke-virtual {v2}, Lcom/litesuits/orm/db/assit/QueryBuilder;->createStatement()Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    .line 338
    .local v2, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    iget-object v3, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v3}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getReadableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v3

    invoke-virtual {v2, v3, p2}, Lcom/litesuits/orm/db/assit/SQLStatement;->query(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Class;)Ljava/util/ArrayList;

    move-result-object v3

    .line 339
    .local v3, "list":Ljava/util/ArrayList;, "Ljava/util/ArrayList<TT;>;"
    invoke-static {v3}, Lcom/litesuits/orm/db/assit/Checker;->isEmpty(Ljava/util/Collection;)Z

    move-result v4

    if-nez v4, :cond_51

    .line 340
    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0
    :try_end_4d
    .catchall {:try_start_12 .. :try_end_4d} :catchall_55

    .line 343
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return-object v0

    .end local v2    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    .end local v3    # "list":Ljava/util/ArrayList;, "Ljava/util/ArrayList<TT;>;"
    :cond_51
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 344
    goto :goto_5a

    .line 343
    :catchall_55
    move-exception v0

    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v0

    .line 346
    :cond_5a
    :goto_5a
    const/4 v0, 0x0

    return-object v0
.end method

.method public save(Ljava/util/Collection;)I
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;)I"
        }
    .end annotation

    .line 69
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 71
    :try_start_3
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/Checker;->isEmpty(Ljava/util/Collection;)Z

    move-result v0

    if-nez v0, :cond_28

    .line 72
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 73
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .line 74
    .local v1, "entity":Ljava/lang/Object;
    iget-object v2, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v2, v0, v1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 75
    invoke-static {v1}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildReplaceAllSql(Ljava/lang/Object;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    .line 76
    .local v2, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    invoke-virtual {v2, v0, p1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execInsertCollection(Landroid/database/sqlite/SQLiteDatabase;Ljava/util/Collection;)I

    move-result v3
    :try_end_24
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_24} :catch_2e
    .catchall {:try_start_3 .. :try_end_24} :catchall_2c

    .line 81
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v3

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    .end local v1    # "entity":Ljava/lang/Object;
    .end local v2    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    :cond_28
    :goto_28
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 82
    goto :goto_33

    .line 81
    :catchall_2c
    move-exception v0

    goto :goto_35

    .line 78
    :catch_2e
    move-exception v0

    .line 79
    .local v0, "e":Ljava/lang/Exception;
    :try_start_2f
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_32
    .catchall {:try_start_2f .. :try_end_32} :catchall_2c

    .end local v0    # "e":Ljava/lang/Exception;
    goto :goto_28

    .line 83
    :goto_33
    const/4 v0, -0x1

    return v0

    .line 81
    :goto_35
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    goto :goto_3a

    :goto_39
    throw v0

    :goto_3a
    goto :goto_39
.end method

.method public save(Ljava/lang/Object;)J
    .registers 5
    .param p1, "entity"    # Ljava/lang/Object;

    .line 54
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 56
    :try_start_3
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 57
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v1, v0, p1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 58
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildReplaceSql(Ljava/lang/Object;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v1

    invoke-virtual {v1, v0, p1}, Lcom/litesuits/orm/db/assit/SQLStatement;->execInsert(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)J

    move-result-wide v1
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_16} :catch_1c
    .catchall {:try_start_3 .. :try_end_16} :catchall_1a

    .line 62
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return-wide v1

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catchall_1a
    move-exception v0

    goto :goto_27

    .line 59
    :catch_1c
    move-exception v0

    .line 60
    .local v0, "e":Ljava/lang/Exception;
    :try_start_1d
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_20
    .catchall {:try_start_1d .. :try_end_20} :catchall_1a

    .line 62
    .end local v0    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 63
    nop

    .line 64
    const-wide/16 v0, -0x1

    return-wide v0

    .line 62
    :goto_27
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v0
.end method

.method public single()Lcom/litesuits/orm/LiteOrm;
    .registers 1

    .line 41
    return-object p0
.end method

.method public update(Ljava/lang/Object;)I
    .registers 3
    .param p1, "entity"    # Ljava/lang/Object;

    .line 132
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, v0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->update(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I

    move-result v0

    return v0
.end method

.method public update(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I
    .registers 6
    .param p1, "entity"    # Ljava/lang/Object;
    .param p2, "cvs"    # Lcom/litesuits/orm/db/model/ColumnsValue;
    .param p3, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;

    .line 142
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 144
    :try_start_3
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 145
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    iget-object v1, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v1, v0, p1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 146
    invoke-static {p1, p2, p3}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildUpdateSql(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/litesuits/orm/db/assit/SQLStatement;->execUpdate(Landroid/database/sqlite/SQLiteDatabase;)I

    move-result v1
    :try_end_16
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_16} :catch_1c
    .catchall {:try_start_3 .. :try_end_16} :catchall_1a

    .line 150
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v1

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    :catchall_1a
    move-exception v0

    goto :goto_26

    .line 147
    :catch_1c
    move-exception v0

    .line 148
    .local v0, "e":Ljava/lang/Exception;
    :try_start_1d
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_20
    .catchall {:try_start_1d .. :try_end_20} :catchall_1a

    .line 150
    .end local v0    # "e":Ljava/lang/Exception;
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 151
    nop

    .line 152
    const/4 v0, -0x1

    return v0

    .line 150
    :goto_26
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    throw v0
.end method

.method public update(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I
    .registers 4
    .param p1, "entity"    # Ljava/lang/Object;
    .param p2, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;

    .line 137
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, p2}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->update(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I

    move-result v0

    return v0
.end method

.method public update(Ljava/util/Collection;)I
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;)I"
        }
    .end annotation

    .line 157
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, v0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->update(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I

    move-result v0

    return v0
.end method

.method public update(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I
    .registers 8
    .param p2, "cvs"    # Lcom/litesuits/orm/db/model/ColumnsValue;
    .param p3, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;",
            "Lcom/litesuits/orm/db/model/ColumnsValue;",
            "Lcom/litesuits/orm/db/model/ConflictAlgorithm;",
            ")I"
        }
    .end annotation

    .line 167
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->acquireReference()V

    .line 169
    :try_start_3
    invoke-static {p1}, Lcom/litesuits/orm/db/assit/Checker;->isEmpty(Ljava/util/Collection;)Z

    move-result v0

    if-nez v0, :cond_28

    .line 170
    iget-object v0, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mHelper:Lcom/litesuits/orm/db/assit/SQLiteHelper;

    invoke-virtual {v0}, Lcom/litesuits/orm/db/assit/SQLiteHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    .line 171
    .local v0, "db":Landroid/database/sqlite/SQLiteDatabase;
    invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    .line 172
    .local v1, "entity":Ljava/lang/Object;
    iget-object v2, p0, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->mTableManager:Lcom/litesuits/orm/db/TableManager;

    invoke-virtual {v2, v0, v1}, Lcom/litesuits/orm/db/TableManager;->checkOrCreateTable(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/Object;)Lcom/litesuits/orm/db/model/EntityTable;

    .line 173
    invoke-static {v1, p2, p3}, Lcom/litesuits/orm/db/assit/SQLBuilder;->buildUpdateAllSql(Ljava/lang/Object;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)Lcom/litesuits/orm/db/assit/SQLStatement;

    move-result-object v2

    .line 174
    .local v2, "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    invoke-virtual {v2, v0, p1, p2}, Lcom/litesuits/orm/db/assit/SQLStatement;->execUpdateCollection(Landroid/database/sqlite/SQLiteDatabase;Ljava/util/Collection;Lcom/litesuits/orm/db/model/ColumnsValue;)I

    move-result v3
    :try_end_24
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_24} :catch_2e
    .catchall {:try_start_3 .. :try_end_24} :catchall_2c

    .line 179
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    return v3

    .end local v0    # "db":Landroid/database/sqlite/SQLiteDatabase;
    .end local v1    # "entity":Ljava/lang/Object;
    .end local v2    # "stmt":Lcom/litesuits/orm/db/assit/SQLStatement;
    :cond_28
    :goto_28
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    .line 180
    goto :goto_33

    .line 179
    :catchall_2c
    move-exception v0

    goto :goto_35

    .line 176
    :catch_2e
    move-exception v0

    .line 177
    .local v0, "e":Ljava/lang/Exception;
    :try_start_2f
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_32
    .catchall {:try_start_2f .. :try_end_32} :catchall_2c

    .end local v0    # "e":Ljava/lang/Exception;
    goto :goto_28

    .line 181
    :goto_33
    const/4 v0, -0x1

    return v0

    .line 179
    :goto_35
    invoke-virtual {p0}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->releaseReference()V

    goto :goto_3a

    :goto_39
    throw v0

    :goto_3a
    goto :goto_39
.end method

.method public update(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I
    .registers 4
    .param p2, "conflictAlgorithm"    # Lcom/litesuits/orm/db/model/ConflictAlgorithm;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Ljava/util/Collection<",
            "TT;>;",
            "Lcom/litesuits/orm/db/model/ConflictAlgorithm;",
            ")I"
        }
    .end annotation

    .line 162
    .local p1, "collection":Ljava/util/Collection;, "Ljava/util/Collection<TT;>;"
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, p2}, Lcom/litesuits/orm/db/impl/SingleSQLiteImpl;->update(Ljava/util/Collection;Lcom/litesuits/orm/db/model/ColumnsValue;Lcom/litesuits/orm/db/model/ConflictAlgorithm;)I

    move-result v0

    return v0
.end method