/** ROLE_ID でリストを取得 */ public List<RoleFunctionsEntity> physicalSelectOnRoleId(Integer roleId) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_physical_select_on_role_id.sql"); return executeQueryList(sql, RoleFunctionsEntity.class, roleId); }
/** キーで1件取得 */ public RoleFunctionsEntity selectOnKey(String functionKey, Integer roleId) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_select_on_key.sql"); return executeQuerySingle(sql, RoleFunctionsEntity.class, functionKey, roleId); }
/** FUNCTION_KEY でリストを取得 */ public List<RoleFunctionsEntity> physicalSelectOnFunctionKey(String functionKey) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_physical_select_on_function_key.sql"); return executeQueryList(sql, RoleFunctionsEntity.class, functionKey); }
/** * Physical Insert. it is not create key on database sequence. * * @param entity entity * @return saved entity */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public CommentsEntity rawPhysicalInsert(CommentsEntity entity) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_raw_insert.sql"); executeUpdate( sql, entity.getCommentNo(), entity.getKnowledgeId(), entity.getComment(), entity.getCommentStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), entity.getUpdateDatetime(), entity.getDeleteFlag()); String driverClass = ConnectionManager.getInstance().getDriverClass(getConnectionName()); if (ORMappingParameter.DRIVER_NAME_POSTGRESQL.equals(driverClass)) { String setValSql = "select setval('COMMENTS_COMMENT_NO_seq', (select max(COMMENT_NO) from COMMENTS));"; executeQuerySingle(setValSql, Long.class); } return entity; }
/** 全て取得 */ public List<RoleFunctionsEntity> selectAll() { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_select_all.sql"); return executeQueryList(sql, RoleFunctionsEntity.class); }
public KnowledgeHistoriesEntity selectOnKeyWithName(Integer historyNo, Long knowledgeId) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_selectOnKeyWithName.sql"); return executeQuerySingle(sql, KnowledgeHistoriesEntity.class, knowledgeId, historyNo); }
/** * sequenceをリセットする * * @return void */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public void resetSequence() { String sql = SQLManager.getInstance() .getSql("/org/support/project/web/dao/sql/GroupsDao/GroupsDao_alter_sequence.sql"); executeUpdate(sql); }
/** * Select all data that not deleted with pager. * * @param limit limit * @param offset offset * @return all data */ public List<CommentsEntity> selectAllWidthPager(int limit, int offset) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_all_with_pager.sql"); return executeQueryList(sql, CommentsEntity.class, limit, offset); }
public List<KnowledgeHistoriesEntity> selectOnKnowledge(Long knowledgeId, int offset, int limit) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/KnowledgeHistoriesDao/KnowledgeHistoriesDao_selectOnKnowledge.sql"); return executeQueryList(sql, KnowledgeHistoriesEntity.class, knowledgeId, limit, offset); }
/** * Select data on key. * * @param commentNo commentNo * @return data */ public CommentsEntity physicalSelectOnKey(Long commentNo) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_physical_select_on_key.sql"); return executeQuerySingle(sql, CommentsEntity.class, commentNo); }
/** * Select all data that not deleted. * * @return all data */ public List<CommentsEntity> selectAll() { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_all.sql"); return executeQueryList(sql, CommentsEntity.class); }
/** * Physical Delete. * * @param commentNo commentNo */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public void physicalDelete(Long commentNo) { String sql = SQLManager.getInstance() .getSql("/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_delete.sql"); executeUpdate(sql, commentNo); }
/** * アクセスできるグループを取得 * * @param keyword * @param loginedUser * @param offset * @param limit * @return */ public List<GroupsEntity> selectAccessAbleGroups(LoginedUser loginedUser, int offset, int limit) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/GroupsDao/GroupsDao_selectAccessAbleGroups.sql"); return executeQueryList(sql, GroupsEntity.class, loginedUser.getUserId(), limit, offset); }
/** * キーワードでグループを取得 * * @param keyword * @param loginedUser * @param offset * @param limit * @return */ public List<GroupsEntity> selectOnKeyword( String keyword, LoginedUser loginedUser, int offset, int limit) { if (loginedUser != null && loginedUser.isAdmin()) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/GroupsDao/GroupsDao_selectAdminOnKeyword.sql"); return executeQueryList(sql, GroupsEntity.class, keyword, limit, offset); } else { String sql = SQLManager.getInstance() .getSql("/org/support/project/web/dao/sql/GroupsDao/GroupsDao_selectOnKeyword.sql"); return executeQueryList( sql, GroupsEntity.class, keyword, loginedUser.getUserId(), limit, offset); } }
/** * アクセス可能なグループを取得 ※アクセス可能というのはUSER_GROUPSに登録されている、もしくは、「公開」か「保護」のもの * * @param groupId * @param loginedUser * @return */ public GroupsEntity selectAccessAbleGroup(Integer groupId, LoginedUser loginedUser) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/GroupsDao/GroupsDao_selectAccessAbleGroup.sql"); return executeQuerySingle(sql, GroupsEntity.class, groupId, loginedUser.getUserId()); }
/** * Select count that not deleted. * * @return count */ public Integer selectCountAll() { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_select_count_all.sql"); return executeQuerySingle(sql, Integer.class); }
/** * 自分が登録したストックを取得 (ナレッジIDを指定し、各ストックにそのナレッジがストックされているかも同時に取得) * * @param loginedUser * @param knowledgeId * @param i * @param listLimit * @return */ public List<Stock> selectMyStocksWithStocked( LoginedUser loginedUser, Long knowledgeId, int offset, int limit) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/knowledge/dao/sql/StocksDao/StocksDao_selectMyStocksWithStocked.sql"); return executeQueryList(sql, Stock.class, knowledgeId, loginedUser.getUserId(), limit, offset); }
/** 削除(データを生で操作/物理削除) */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public void physicalDelete(String functionKey, Integer roleId) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_delete.sql"); executeUpdate(sql, functionKey, roleId); }
/** 更新(データを生で操作) */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public RoleFunctionsEntity physicalUpdate(RoleFunctionsEntity entity) { String sql = SQLManager.getInstance() .getSql( "/org/support/project/web/dao/sql/RoleFunctionsDao/RoleFunctionsDao_update.sql"); executeUpdate( sql, entity.getRowId(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), entity.getUpdateDatetime(), entity.getDeleteFlag(), entity.getFunctionKey(), entity.getRoleId()); return entity; }
/** * Physical Update. * * @param entity entity * @return saved entity */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public CommentsEntity physicalUpdate(CommentsEntity entity) { String sql = SQLManager.getInstance() .getSql("/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_update.sql"); executeUpdate( sql, entity.getKnowledgeId(), entity.getComment(), entity.getCommentStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), entity.getUpdateDatetime(), entity.getDeleteFlag(), entity.getCommentNo()); return entity; }
/** * Physical Insert. if key column have sequence, key value create by database. * * @param entity entity * @return saved entity */ @Aspect(advice = org.support.project.ormapping.transaction.Transaction.class) public CommentsEntity physicalInsert(CommentsEntity entity) { String sql = SQLManager.getInstance() .getSql("/org/support/project/knowledge/dao/sql/CommentsDao/CommentsDao_insert.sql"); Class<?> type = PropertyUtil.getPropertyType(entity, "commentNo"); Object key = executeInsert( sql, type, entity.getKnowledgeId(), entity.getComment(), entity.getCommentStatus(), entity.getInsertUser(), entity.getInsertDatetime(), entity.getUpdateUser(), entity.getUpdateDatetime(), entity.getDeleteFlag()); PropertyUtil.setPropertyValue(entity, "commentNo", key); return entity; }
/** * グループ名からグループを取得 * * @param groupName * @return */ public GroupsEntity selectOnGroupName(String groupName) { String sql = SQLManager.getInstance() .getSql("/org/support/project/web/dao/sql/GroupsDao/GroupsDao_selectOnGroupName.sql"); return executeQuerySingle(sql, GroupsEntity.class, groupName); }