@Test public void testInsert() throws Exception { }
@Override public long insert(Requirement entity) { Cursor cursor = super.query(RequirementTable.IDENTITY_ID +"=?", new String[]{String.valueOf(entity.getIdentityId())}); if(cursor.moveToFirst()){ entity.setId(cursor.getLong(cursor.getColumnIndex(RequirementTable._ID))); super.update(entity,entity.getId()); }else{ entity.setId(super.insert(entity)); } cursor.close(); return entity.getId(); }
RequirementSql extends AbstractSql<Requirement> { @Override public long insert(Requirement entity) { Cursor cursor = super.query(RequirementTable.IDENTITY_ID +"=?", new String[]{String.valueOf(entity.getIdentityId())}); if(cursor.moveToFirst()){ entity.setId(cursor.getLong(cursor.getColumnIndex(RequirementTable._ID))); super.update(entity,entity.getId()); }else{ entity.setId(super.insert(entity)); } cursor.close(); return entity.getId(); } }
RequirementSql extends AbstractSql<Requirement> { @Override public long insert(Requirement entity) { Cursor cursor = super.query(RequirementTable.IDENTITY_ID +"=?", new String[]{String.valueOf(entity.getIdentityId())}); if(cursor.moveToFirst()){ entity.setId(cursor.getLong(cursor.getColumnIndex(RequirementTable._ID))); super.update(entity,entity.getId()); }else{ entity.setId(super.insert(entity)); } cursor.close(); return entity.getId(); } RequirementSql(Context context); }
RequirementSql extends AbstractSql<Requirement> { @Override public long insert(Requirement entity) { Cursor cursor = super.query(RequirementTable.IDENTITY_ID +"=?", new String[]{String.valueOf(entity.getIdentityId())}); if(cursor.moveToFirst()){ entity.setId(cursor.getLong(cursor.getColumnIndex(RequirementTable._ID))); super.update(entity,entity.getId()); }else{ entity.setId(super.insert(entity)); } cursor.close(); return entity.getId(); } RequirementSql(Context context); @Override long insert(Requirement entity); @Override String getCreation(); @Override Requirement fromCursor(Cursor cursor); @Override ContentValues toContentValues(Requirement entity); }
RequirementSql extends AbstractSql<Requirement> { @Override public long insert(Requirement entity) { Cursor cursor = super.query(RequirementTable.IDENTITY_ID +"=?", new String[]{String.valueOf(entity.getIdentityId())}); if(cursor.moveToFirst()){ entity.setId(cursor.getLong(cursor.getColumnIndex(RequirementTable._ID))); super.update(entity,entity.getId()); }else{ entity.setId(super.insert(entity)); } cursor.close(); return entity.getId(); } RequirementSql(Context context); @Override long insert(Requirement entity); @Override String getCreation(); @Override Requirement fromCursor(Cursor cursor); @Override ContentValues toContentValues(Requirement entity); static final Uri URI; static final int CODE; }