{"id":294,"date":"2023-02-05T11:38:24","date_gmt":"2023-02-05T11:38:24","guid":{"rendered":"https:\/\/valerio.nu\/?p=294"},"modified":"2023-02-05T11:38:25","modified_gmt":"2023-02-05T11:38:25","slug":"understand-jpa-using-restful-services","status":"publish","type":"post","link":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/","title":{"rendered":"Understand JPA using Restful Services"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction<\/strong><\/h2>\n\n\n\n<p>In this tutorial, we are introducing JPA using restful services. Spring Data is an aspect of the Spring Boot family that focuses on how data is manipulated. With data consistently becoming part of our business process, the need to understand how to create, read and update data is important. Thankfully, Spring Data JPA provides an efficient way for data manipulation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>General Overview<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/spring.io\/projects\/spring-data-jpa#overview\">Spring Data JPA<\/a> is a framework that simplifies the implementation of JPA (Java Persistence API) based repositories. It provides a high-level repository abstraction for accessing data in databases, reducing the amount of boilerplate code required to implement the data access layer. Spring Data JPA allows you to perform database operations using predefined method names or custom query methods.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Getting Started<\/strong><\/h2>\n\n\n\n<p>The general requirement needed for this tutorial include:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Spring Boot 2.7* and above<\/li>\n\n\n\n<li>Spring Data JPA<\/li>\n\n\n\n<li>JDK 8 and above<\/li>\n\n\n\n<li>Database connector (e.g. MySQL)<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Implementation &#8211; Setting up the JPA interface<\/strong><\/h3>\n\n\n\n<p>JPA (Java Persistence API) is a Java specification for accessing, storing and managing data between Java objects\/classes and relational databases (MySQL, PostgreSQL, etc.). Spring Boot provides a convenient way to use JPA through the Spring Data JPA project which provides a repository abstraction on top of JPA.<\/p>\n\n\n\n<p>For example in our code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public interface UserRepository extends CrudRepository&lt;User, Long&gt; {\n\n    User findByTheUsersName(String username);\n\n    Optional&lt;User&gt; findByUsername(Optional&lt;String&gt; username);\n\n    List&lt;User&gt; findByLastname(String lastname);\n\n    @Query(\"select u from User u where u.firstname = :firstname\")\n    List&lt;User&gt; findByFirstname(String firstname);\n\n    @Query(\"select u from User u where u.firstname = :name or u.lastname = :name\")\n    List&lt;User&gt; findByFirstnameOrLastname(String name);\n\n    @Query(\"select u from User u where u.firstname = :#{#user.firstname} or u.lastname = :#{#user.lastname}\")\n    Iterable&lt;User&gt; findByFirstnameOrLastname(User user);\n\n}<\/code><\/pre>\n\n\n\n<p>The code above shows the implementation of our JPA repository. It supports custom queries and provides flexible means of fetching user data. An automated CRUD (create, read, update, and delete) method is imported due to the inclusion of the CRUDRepository.\u00a0<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><strong>Adding the Model<\/strong><\/strong><\/h3>\n\n\n\n<p>To keep things simple, we created a <strong>User <\/strong>model consisting of a username, first name, and last name.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> private static final long serialVersionUID = -2952735933715107252L;\n\n    @Column(unique = true) private String username;\n\n    private String firstname;\n    private String lastname;\n\n    public User() {\n        this(null);\n    }\n\n    \/**\n     * Creates a new user instance.\n     *\/\n    public User(Long id) {\n        this.setId(id);\n    }\n\n    public User(String firstname, String lastname) {\n        this.firstname = firstname;\n        this.lastname = lastname;\n    }<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Application settings and Pom.xml&nbsp;<\/strong><\/h3>\n\n\n\n<p>In this tutorial we are using H2 in-memory database although any database can be configured inside the application.properties file. Maven repositories used can be found in pom.xml file of this tutorial.\u00a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\nspring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1\nspring.h2.console.enabled=true\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Service class<\/strong><\/h3>\n\n\n\n<p>In the service class, we implemented the interface<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Service\npublic class SimpleUserImpl implements SimpleUserRepo {\n  private final UserRepository userRepository;\n  public SimpleUserImpl(UserRepository userRepository) {\n        this.userRepository = userRepository;\n    }\n    @Override\n    public User Post(User params) {\n        userRepository.save(params);\n        return params;\n    }\n    @Override\n    public List&lt;User&gt; Get() {\n        return (List&lt;User&gt;) userRepository.findAll();\n    }\n    @Override\n    public User Get(long id) {\n        return userRepository.findById(id).get();\n    }\n    @Override\n    public User Update(User params, long id) {\n\n        User user =  userRepository.findById(id).get();\n        user.setFirstname(params.getFirstname());\n        user.setLastname(params.getLastname());\n\n        return userRepository.save(user);\n    }\n    @Override\n    public String Delete(long id) {\n        userRepository.deleteById(id);\n        return \"User(\" + id + \")\" + \" has been deleted!\";\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>The Controller Endpoints<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>@RestController\npublic class UserController {\n    private final SimpleUserImpl userService;\n\n    public UserController(SimpleUserImpl userService, UserRepository userRepository) {\n        this.userService = userService;\n    }\n\n    \/\/ Add\n    @PostMapping(value = \"\/users\")\n    public User Post(@RequestBody User params) {\n        return userService.Post(params);\n    }\n\n    \/\/ Get\n    @GetMapping(value = \"\/users\")\n    public List&lt;User&gt; Get() {\n        return userService.Get();\n    }\n\n    \/\/ Get By ID\n    @GetMapping(value = \"\/users\/{id}\")\n    public User Get(@PathVariable int id) {\n        return userService.Get(id);\n    }\n\n    \/\/ Update\n    @PutMapping(value = \"\/users\/{id}\")\n    public User Update(@PathVariable int id, @RequestBody User params) {\n        return userService.Update(params, id);\n    }\n\n    \/\/ Delete\n    @DeleteMapping(value = \"\/users\/{id}\")\n    public String Delete(@PathVariable int id) {\n        return userService.Delete(id);\n    }\n\n}<\/code><\/pre>\n\n\n\n<p>Endpoints following our complete implementation <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png\" alt=\"\" class=\"wp-image-299\" srcset=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png 1024w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-300x188.png 300w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-768x480.png 768w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1536x960.png 1536w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-2048x1280.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 1. Image showing the creation of a user<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-1024x560.png\" alt=\"\" class=\"wp-image-298\" srcset=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-1024x560.png 1024w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-300x164.png 300w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-768x420.png 768w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-1536x839.png 1536w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.37-2048x1119.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 2. Image showing a single user<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"684\" src=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-1024x684.png\" alt=\"\" class=\"wp-image-300\" srcset=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-1024x684.png 1024w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-300x201.png 300w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-768x513.png 768w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-1536x1027.png 1536w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.45.11-2048x1369.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Fig 3. Image showing all registered users<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>In this tutorial we have demonstrated how to implement CRUD operations using JPA and Restful services. The various endpoints were tested using Postman. As always, the code for this tutorial is available on our <a href=\"https:\/\/github.com\/valerio-nu\/spring-data-jpa\">GitHub repository<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this tutorial, we are introducing JPA using restful services. Spring Data is an aspect of the Spring Boot family that focuses on how [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-294","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f\" \/>\n<meta property=\"og:description\" content=\"Introduction In this tutorial, we are introducing JPA using restful services. Spring Data is an aspect of the Spring Boot family that focuses on how [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/\" \/>\n<meta property=\"og:site_name\" content=\"Andy&#039;s blog \u2935\ufe0f\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-05T11:38:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-05T11:38:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png\" \/>\n<meta name=\"author\" content=\"andy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"andy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/\"},\"author\":{\"name\":\"andy\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\"},\"headline\":\"Understand JPA using Restful Services\",\"datePublished\":\"2023-02-05T11:38:24+00:00\",\"dateModified\":\"2023-02-05T11:38:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/\"},\"wordCount\":388,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/\",\"url\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/\",\"name\":\"Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png\",\"datePublished\":\"2023-02-05T11:38:24+00:00\",\"dateModified\":\"2023-02-05T11:38:25+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#primaryimage\",\"url\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Screenshot-2023-02-02-at-15.43.11-1.png\",\"contentUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/Screenshot-2023-02-02-at-15.43.11-1.png\",\"width\":2339,\"height\":1462},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/02\\\/05\\\/understand-jpa-using-restful-services\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/valerio.nu\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understand JPA using Restful Services\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#website\",\"url\":\"https:\\\/\\\/valerio.nu\\\/\",\"name\":\"Andy&#039;s blog \u2935\ufe0f\",\"description\":\"Abandon all hope, ye who enter here\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/valerio.nu\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\",\"name\":\"andy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"caption\":\"andy\"},\"sameAs\":[\"https:\\\/\\\/valerio.nu\"],\"url\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/author\\\/giuseppe\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/","og_locale":"en_US","og_type":"article","og_title":"Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f","og_description":"Introduction In this tutorial, we are introducing JPA using restful services. Spring Data is an aspect of the Spring Boot family that focuses on how [&hellip;]","og_url":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/","og_site_name":"Andy&#039;s blog \u2935\ufe0f","article_published_time":"2023-02-05T11:38:24+00:00","article_modified_time":"2023-02-05T11:38:25+00:00","og_image":[{"url":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png","type":"","width":"","height":""}],"author":"andy","twitter_card":"summary_large_image","twitter_misc":{"Written by":"andy","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#article","isPartOf":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/"},"author":{"name":"andy","@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128"},"headline":"Understand JPA using Restful Services","datePublished":"2023-02-05T11:38:24+00:00","dateModified":"2023-02-05T11:38:25+00:00","mainEntityOfPage":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/"},"wordCount":388,"commentCount":1,"image":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#primaryimage"},"thumbnailUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/","url":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/","name":"Understand JPA using Restful Services - Andy&#039;s blog \u2935\ufe0f","isPartOf":{"@id":"https:\/\/valerio.nu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#primaryimage"},"image":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#primaryimage"},"thumbnailUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1-1024x640.png","datePublished":"2023-02-05T11:38:24+00:00","dateModified":"2023-02-05T11:38:25+00:00","author":{"@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128"},"breadcrumb":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#primaryimage","url":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1.png","contentUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/02\/Screenshot-2023-02-02-at-15.43.11-1.png","width":2339,"height":1462},{"@type":"BreadcrumbList","@id":"https:\/\/valerio.nu\/index.php\/2023\/02\/05\/understand-jpa-using-restful-services\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/valerio.nu\/"},{"@type":"ListItem","position":2,"name":"Understand JPA using Restful Services"}]},{"@type":"WebSite","@id":"https:\/\/valerio.nu\/#website","url":"https:\/\/valerio.nu\/","name":"Andy&#039;s blog \u2935\ufe0f","description":"Abandon all hope, ye who enter here","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/valerio.nu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128","name":"andy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","caption":"andy"},"sameAs":["https:\/\/valerio.nu"],"url":"https:\/\/valerio.nu\/index.php\/author\/giuseppe\/"}]}},"_links":{"self":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/comments?post=294"}],"version-history":[{"count":4,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions"}],"predecessor-version":[{"id":304,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/294\/revisions\/304"}],"wp:attachment":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/media?parent=294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/categories?post=294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/tags?post=294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}