Esempio n. 1
0
 /** 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);
 }
Esempio n. 2
0
 /** キーで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);
 }
Esempio n. 3
0
 /** 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);
 }
Esempio n. 4
0
 /**
  * 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;
 }
Esempio n. 5
0
 /** 全て取得 */
 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);
 }
Esempio n. 7
0
 /**
  * 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);
 }
Esempio n. 8
0
 /**
  * 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);
 }
Esempio n. 10
0
 /**
  * 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);
 }
Esempio n. 11
0
 /**
  * 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);
 }
Esempio n. 12
0
 /**
  * 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);
 }
Esempio n. 13
0
 /**
  * アクセスできるグループを取得
  *
  * @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);
 }
Esempio n. 14
0
 /**
  * キーワードでグループを取得
  *
  * @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);
   }
 }
Esempio n. 15
0
 /**
  * アクセス可能なグループを取得 ※アクセス可能というのは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());
 }
Esempio n. 16
0
 /**
  * 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);
 }
Esempio n. 17
0
 /**
  * 自分が登録したストックを取得 (ナレッジ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);
 }
Esempio n. 18
0
 /** 削除(データを生で操作/物理削除) */
 @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);
 }
Esempio n. 19
0
 /** 更新(データを生で操作) */
 @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;
 }
Esempio n. 20
0
 /**
  * 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;
 }
Esempio n. 21
0
 /**
  * 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;
 }
Esempio n. 22
0
 /**
  * グループ名からグループを取得
  *
  * @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);
 }