mirror of
https://gitee.com/many2many/java-web.git
synced 2025-01-11 14:40:55 +08:00
changed
This commit is contained in:
parent
5c6259fb8a
commit
4d7706073c
@ -7,15 +7,15 @@ import org.springframework.data.repository.query.Param;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface UserRepository extends JpaRepository<User, Long> {
|
public interface UserRepository extends JpaRepository<User, Long> {
|
||||||
|
|
||||||
List<User> findByNameLikeOrderByAgeDesc(String name);
|
List<User> findByNameLikeOrderByAgeDesc(String name);
|
||||||
|
|
||||||
@Query("Select u from User u where u.name like %?1% order by u.age desc")
|
@Query("Select u from User u where u.name like %?1% order by u.age desc")
|
||||||
List<User> abcd(String name);
|
List<User> abcd(String name);
|
||||||
|
|
||||||
@Query("Select u from User u where u.name like %:name% order by u.age desc")
|
@Query("Select u from User u where u.name like %:userName% order by u.age desc")
|
||||||
List<User> dcba(@Param("name") String name);
|
List<User> dcba(@Param("userName") String name);
|
||||||
|
|
||||||
@Query(value = "Select * from Users u where u.name like %?1% order by u.age desc", nativeQuery = true)
|
@Query(value = "Select * from Users u where u.name like %?1% order by u.age desc", nativeQuery = true)
|
||||||
List<User> queryUsersByName(String name);
|
List<User> queryUsersByName(String name);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
# format_sql: true # 保持原样,用于格式化SQL输出
|
# format_sql: true # 保持原样,用于格式化SQL输出
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
jackson:
|
jackson:
|
||||||
property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
||||||
@ -38,3 +39,8 @@ spring:
|
|||||||
database-platform: org.hibernate.dialect.H2Dialect
|
database-platform: org.hibernate.dialect.H2Dialect
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: update
|
ddl-auto: update
|
||||||
|
|
||||||
|
|
||||||
|
my:
|
||||||
|
file:
|
||||||
|
path: /tmp
|
Loading…
Reference in New Issue
Block a user