0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

springboot repositoryにupdate文を作成するサンプル

Posted at

package test.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import test.TestEntity;

@Repository
public interface TestEntityRepository extends JpaRepository{

@Transactional
@Modifying
@Query("update TestEntityset UPDATE_DT=:UPDATE_DT UPDATE_ID=:UPDATE_ID where ID=:ID")
int updateBase(@Param("UPDATE_DT")LocalDateTime UPDATE_D,@Param("UPDATE_ID")String UPDATE_ID,@Param("ID")int ID);

}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?