英文:
Are there any methods to get database metrics in spring?
问题
我有一个简单的CRUD应用程序,它与PostgreSQL数据库一起使用。
所以我想知道,是否有收集数据库指标的方法,比如:
首次添加实体的日期,最后添加实体的日期,具有特定值的实体数量等等?
英文:
I have a simple CRUD application that works with PostgreSQL database.
So I would like to know, are there any methods for collecting database metrics such as:
Date of first added entity, date of last added entity, amount of entities with specific value, etc.?
答案1
得分: 0
你可以将这个业务逻辑简单地作为一个服务添加,并创建RESTful接口来传递数据,就像处理其他任何业务用例一样。
当我阅读到类似"具有特定值的实体数量"这样的内容时,这就是一个查询。
你可以使用Spring Data JPA方法来创建这些简单的查询。
类似于:
findByFieldEquals(String value);
英文:
You can simply add this business logic as a service and create the RESTful interface to deliver the data, just as you would any other business use case.
When I read things like "amount of entities with specific value" - this is a query.
You can create these simply queries using Spring Data JPA methods.
Something like:
findByFieldEquals(String value);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论