public JwSqlUpdate composeUpdate(AcUploadDownloadFile e) { JwSqlUpdate st = createUpdate(); st.setTable(TABLE); st.setValue(PATH, JwUtility.truncate(e.getPath(), PATH_MAX_LENGTH, true)); st.setValue(FILE_NAME, JwUtility.truncate(e.getFileName(), FILE_NAME_MAX_LENGTH, true)); st.setValue(DESCRIPTION, JwUtility.truncate(e.getDescription(), DESCRIPTION_MAX_LENGTH, true)); st.setValue(CREATED_UTC_TS, e.getCreatedUtcTs()); st.where().isEqual(ID, e.getId()); return st; }
public AcUploadDownloadFile read(JwSqlResultSet rs) { AcUploadDownloadFile e; e = getAccess().newUploadDownloadFile(); e.setId(rs.getInteger()); e.setPath(rs.getString()); e.setFileName(rs.getString()); e.setDescription(rs.getString()); e.setCreatedUtcTs(rs.getTimestamp()); return e; }
public JwSqlInsert _checkAndComposeInsert(JwList<AcUploadDownloadFile> v, boolean insertIds) { for (AcUploadDownloadFile e : v) { defaultUpdateCount(e); e.validate(); verifyNoMatching(e); } JwSqlInsert st = createInsert(); st.setTable(TABLE); populateInsertColumns(st, insertIds); for (AcUploadDownloadFile e : v) { st.startNewRow(); if (insertIds) st.addIntegerValue(e.getId()); st.addStringValue(JwUtility.truncate(e.getPath(), PATH_MAX_LENGTH, true)); st.addStringValue(JwUtility.truncate(e.getFileName(), FILE_NAME_MAX_LENGTH, true)); st.addStringValue(JwUtility.truncate(e.getDescription(), DESCRIPTION_MAX_LENGTH, true)); st.addTimestampValue(e.getCreatedUtcTs()); } return st; }
public void update(AcUploadDownloadFile e) { e.validate(); JwSqlUpdate st = composeUpdate(e); int i = execute(st); if (i != 1) error("Unable to update AcUploadDownloadFile. Rows updated: %s.", i); }
public void generateIds(JwList<AcUploadDownloadFile> v) { Integer i = getNextId(); for (AcUploadDownloadFile e : v) e.setId(i++); }