【发布时间】:2022-11-03 15:49:53
【问题描述】:
List<ACOrders> acOrders = ordersRepo.findAllByOrderId(44L);
@Repository
public interface ACOrdersRepository extends JpaRepository<ACOrders, Long> {
ACOrders findByOrderId(Long orderId);
}
我使用 mssql 作为数据库,我的属性文件如下:
#mssql
spring.datasource.url=jdbc:sqlserver://<ip>:1433;database=<database>
spring.datasource.username=username
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
spring.jpa.properties.hibernate.format_sql=true
【问题讨论】:
标签: java sql-server jpa