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;
|
||||
|
||||
public interface UserRepository extends JpaRepository<User, Long> {
|
||||
|
||||
List<User> findByNameLikeOrderByAgeDesc(String name);
|
||||
|
||||
@Query("Select u from User u where u.name like %?1% order by u.age desc")
|
||||
List<User> abcd(String name);
|
||||
|
||||
@Query("Select u from User u where u.name like %:name% order by u.age desc")
|
||||
List<User> dcba(@Param("name") String name);
|
||||
@Query("Select u from User u where u.name like %:userName% order by u.age desc")
|
||||
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);
|
||||
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
# format_sql: true # 保持原样,用于格式化SQL输出
|
||||
|
||||
|
||||
|
||||
spring:
|
||||
jackson:
|
||||
property-naming-strategy: SNAKE_CASE # 驼峰转下划线
|
||||
@ -37,4 +38,9 @@ spring:
|
||||
defer-datasource-initialization: true
|
||||
database-platform: org.hibernate.dialect.H2Dialect
|
||||
hibernate:
|
||||
ddl-auto: update
|
||||
ddl-auto: update
|
||||
|
||||
|
||||
my:
|
||||
file:
|
||||
path: /tmp
|
Loading…
Reference in New Issue
Block a user