【发布时间】:2014-10-07 12:34:33
【问题描述】:
我正在使用运行管理器 Swing 将 HSQL DB 作为 Im 内存运行。我必须使用注释从 Spring JPA 存储库连接 HSQLDB 服务器。 我的存储库类。
@RepositoryRestResource
public interface Vehicle extends JpaRepository<Vehicle , BigInteger>{
public List<Vehicle > findAll(Sort sort);
}
服务方式: @服务
public class LocationService {
@Autowired
VehicletRepository vehicleRepository = null;
/**
* This method is to get all the locations from the repository
*/
public List<Vehicle> getVehicless() {
Order order = new Order(Direction.ASC,"vehicleCode");
Sort sort = new Sort(order);
List<Airport> airports = vehicletRepository .findAll(sort);
System.out.println("inside service");
return vehicles;
}
}
任何人都可以使用注释帮助实现 Spring JPA 与 HSQL DB 的连接。
【问题讨论】:
标签: spring jpa annotations hsqldb