protected String getSelectDeep() { if (selectDeep == null) { StringBuilder builder = new StringBuilder("SELECT "); SqlUtils.appendColumns(builder, "T", getAllColumns()); builder.append(','); SqlUtils.appendColumns(builder, "T0", daoSession.getMunkaDao().getAllColumns()); builder.append(" FROM Munkakepek T"); builder.append(" LEFT JOIN Munkak T0 ON T.'MUNKA_ID'=T0.'MUNKA_ID'"); builder.append(' '); selectDeep = builder.toString(); } return selectDeep; }
protected String getSelectDeep() { if (selectDeep == null) { StringBuilder builder = new StringBuilder("SELECT "); SqlUtils.appendColumns(builder, "T", getAllColumns()); builder.append(','); SqlUtils.appendColumns(builder, "T0", daoSession.getBookDao().getAllColumns()); builder.append(" FROM CHAPTER T"); builder.append(" LEFT JOIN BOOK T0 ON T.'GENRE_ID'=T0.'_id'"); builder.append(' '); selectDeep = builder.toString(); } return selectDeep; }
protected String getSelectDeep() { if (selectDeep == null) { StringBuilder builder = new StringBuilder("SELECT "); SqlUtils.appendColumns(builder, "T", getAllColumns()); builder.append(','); SqlUtils.appendColumns(builder, "T0", daoSession.getToOneTarget2Dao().getAllColumns()); builder.append(" FROM RELATION_SOURCE2 T"); builder.append(" LEFT JOIN TO_ONE_TARGET2 T0 ON T.'TO_ONE_ID'=T0.'_id'"); builder.append(' '); selectDeep = builder.toString(); } return selectDeep; }
public Chapter loadDeep(Long key) { assertSinglePk(); if (key == null) { return null; } StringBuilder builder = new StringBuilder(getSelectDeep()); builder.append("WHERE "); SqlUtils.appendColumnsEqValue(builder, "T", getPkColumns()); String sql = builder.toString(); String[] keyArray = new String[] {key.toString()}; Cursor cursor = db.rawQuery(sql, keyArray); try { boolean available = cursor.moveToFirst(); if (!available) { return null; } else if (!cursor.isLast()) { throw new IllegalStateException( "Expected unique result, but count was " + cursor.getCount()); } return loadCurrentDeep(cursor, true); } finally { cursor.close(); } }