Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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;
 }
Exemplo 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);
 }
Exemplo n.º 6
0
 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo n.º 9
0
 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
   }
 }
Exemplo 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());
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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);
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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;
 }
Exemplo 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);
 }