{"id":62495,"date":"2016-12-12T19:00:12","date_gmt":"2016-12-12T17:00:12","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=62495"},"modified":"2016-12-12T09:59:57","modified_gmt":"2016-12-12T07:59:57","slug":"creating-rest-api-speedment-spring","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html","title":{"rendered":"Creating a REST API with Speedment and Spring"},"content":{"rendered":"<p>With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of time on the developer&#8217;s behalf is modelling an existing database in for an example Hibernate to get an object-oriented view of the data. In this tutorial we are going to explore how to use <a href=\"https:\/\/github.com\/speedment\/speedment\">the open source tool Speedment<\/a> together with Spring to generate entities, managers and controllers with the press of a button, enabling you to get started with the development so much faster.<\/p>\n<h2>About Speedment<\/h2>\n<p>Speedment is an open source java toolkit that makes it possible for a developer to rapidly generate all the glue required to communicate with a database. Using a graphical tool, you can connect to a database and generate java sources in seconds. Speedment is built in a modular fashion, just like Spring, making it easy to learn and use only the parts you are interested in. In this article we are going to use a plugin for Speedment to generate Spring controllers in addition to the standard files.<\/p>\n<h2>Step 1: Creating a New Spring Boot Project<\/h2>\n<p>Spring Boot consists of a number of templates that make it easy to get started with a new application. We are going to use one called \u201cspring-boot-starter-web\u201d to set the stage for our web application.<\/p>\n<p>Begin by creating a new Maven Project and add the following to your \u201cpom.xml\u201d-file:<\/p>\n<pre class=\"brush:xml\">&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\" xsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n    &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n    \r\n    &lt;parent&gt;\r\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n        &lt;version&gt;1.4.1.RELEASE&lt;\/version&gt;\r\n    &lt;\/parent&gt;\r\n    \r\n    &lt;groupId&gt;com.github.pyknic&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;speedment-spring-example&lt;\/artifactId&gt;\r\n    &lt;version&gt;1.0.0-SNAPSHOT&lt;\/version&gt;\r\n    &lt;packaging&gt;jar&lt;\/packaging&gt;\r\n    \r\n    &lt;properties&gt;\r\n        &lt;java.version&gt;1.8&lt;\/java.version&gt;\r\n        \r\n        &lt;speedment.version&gt;3.0.1&lt;\/speedment.version&gt;\r\n        &lt;mysql.version&gt;5.1.39&lt;\/mysql.version&gt;\r\n    &lt;\/properties&gt;\r\n    \r\n    &lt;build&gt;\r\n        &lt;plugins&gt;\r\n            &lt;plugin&gt;\r\n                &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;spring-boot-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;\/plugin&gt;\r\n            \r\n            &lt;plugin&gt;\r\n                &lt;groupId&gt;com.speedment&lt;\/groupId&gt;\r\n                &lt;artifactId&gt;speedment-maven-plugin&lt;\/artifactId&gt;\r\n                &lt;version&gt;${speedment.version}&lt;\/version&gt;\r\n                \r\n                &lt;dependencies&gt;\r\n                    &lt;dependency&gt;\r\n                        &lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n                        &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n                        &lt;version&gt;${mysql.version}&lt;\/version&gt;\r\n                    &lt;\/dependency&gt;\r\n                    \r\n                    &lt;dependency&gt;\r\n                        &lt;groupId&gt;com.speedment.plugins&lt;\/groupId&gt;\r\n                        &lt;artifactId&gt;spring-generator&lt;\/artifactId&gt;\r\n                        &lt;version&gt;${speedment.version}&lt;\/version&gt;\r\n                    &lt;\/dependency&gt;\r\n                &lt;\/dependencies&gt;\r\n                \r\n                &lt;configuration&gt;\r\n                    &lt;components&gt;                       \r\n&lt;component&gt;com.speedment.plugins.spring.SpringGeneratorBundle&lt;\/component&gt;\r\n                    &lt;\/components&gt;\r\n                &lt;\/configuration&gt;\r\n            &lt;\/plugin&gt;\r\n        &lt;\/plugins&gt;\r\n    &lt;\/build&gt;\r\n    \r\n    &lt;dependencies&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.speedment&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;runtime&lt;\/artifactId&gt;\r\n            &lt;version&gt;${speedment.version}&lt;\/version&gt;\r\n            &lt;type&gt;pom&lt;\/type&gt;\r\n        &lt;\/dependency&gt;\r\n        \r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;com.speedment.plugins&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-generator&lt;\/artifactId&gt;\r\n            &lt;version&gt;${speedment.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        \r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n            &lt;version&gt;${mysql.version}&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        \r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\r\n        &lt;\/dependency&gt;\r\n    &lt;\/dependencies&gt;\r\n&lt;\/project&gt;<\/pre>\n<p>This will configure your project as a Spring Boot application and tell it to use Speedment with the Spring Generator Plugin.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h2>Step 2: Using Speedment to Generate Sources<\/h2>\n<p>Once the pom-file has been modified, a number of new Maven goals will be available in the IDE. Speedment can be used both graphically or from the command line. In this tutorial, we are going to use the UI. To start the Speedment Tool, execute the following Maven goal on the project:<\/p>\n<pre class=\"brush:java\">mvn speedment:tool<\/pre>\n<p>A dialog will open that let you connect to a database. Once connected, you will see a window with an overview of the database on the left and various configuration options in the center. For this tutorial the default settings will suffice, so simply press \u201cGenerate\u201d in the toolbar.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate.png\"><img decoding=\"async\" class=\"aligncenter wp-image-62523\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate.png\" width=\"860\" height=\"462\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate.png 1600w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate-300x160.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate-768x412.png 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/12\/tool_gui_ready_to_generate-1024x550.png 1024w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>If you switch back to the IDE you will see the new generated sources. You will notice that every class exists in two copies, one of them with the \u201cGenerated\u201d-prefix. The reason for this is to allow modifications without the risk of overwriting your changes should you need to regenerate the sources at some point. Files with the \u201cGenerated\u201d-prefix will always be overwritten and files without it will only be created once.<\/p>\n<h2>Step 3: Create a Main File<\/h2>\n<p>Speedment has generated a complete object-oriented model of the database, but we still need to create an entry point for the application. We will put this in the main package and call it Main.java.<\/p>\n<p><strong>Main.java<\/strong><\/p>\n<pre class=\"brush:java\">package com.github.pyknic.spring;\r\n\r\nimport com.speedment.common.logger.Level;\r\nimport com.speedment.common.logger.LoggerManager;\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\n\r\n@SpringBootApplication\r\npublic class Main {\r\n    \r\n    public static void main(String... args) {\r\n        SpringApplication.run(Main.class, args);\r\n    }\r\n}<\/pre>\n<p>If we start the application, Spring Boot will setup a self-contained web application with a generated controller for every table in the database. We can try it out by going to the following path in a browser:<\/p>\n<pre class=\"brush:java\">http:\/\/localhost:8080\/hare\/<\/pre>\n<p>A JSON representation of the \u201chare\u201d table in my database will now be returned.<\/p>\n<pre class=\"brush:java\">[\r\n    {\"id\":1, \"name\":\"Harry\", \"color\":\"Gray\", \"age\":3},\r\n    {\"id\":2, \"name\":\"Henrietta\", \"color\":\"White\", \"age\":2},\r\n    {\"id\":3, \"name\":\"Henry\", \"color\":\"Black\", \"age\":9}\r\n]<\/pre>\n<p><em>Note #1:<\/em> If you get an exception that says something in style of this&#8230;<\/p>\n<pre class=\"brush:java\">There was an unexpected error (type=Internal Server Error, status=500). \r\nCould not write content: No value present (through reference chain: \r\njava.util.ArrayList[0]...<\/pre>\n<p>&#8230;it probably means that you have nullable columns in your database that Speedment chooses to implement as OptionalLong, OptionalInt etc. You can turn this feature off in the Speedment Tool by setting the &#8220;Nullable Implementation&#8221; field to WRAPPER instead of OPTIONAL for those columns.<\/p>\n<p><em>Note #2:<\/em> If you get an exception in the style of this&#8230;<\/p>\n<pre class=\"brush:java\">java.sql.SQLException: Access denied for user 'root'@'localhost' \r\n(using password: YES)<\/pre>\n<p>&#8230;you will need to create an application.properties-file in the root of the project and add the authentication details for your database.<\/p>\n<p><strong>application.properties<\/strong><\/p>\n<pre class=\"brush:java\">jdbc.username=root\r\njdbc.password=password<\/pre>\n<h2>Summary<\/h2>\n<p>In this article we have used <a href=\"http:\/\/speedment.org\">Speedment<\/a> and the Spring Generator plugin to automatically create a complete Spring Boot Application. Speedment has generated entities, managers and REST controllers for communicating with the database. If you want to know more about Speedment and how you can control the generated code, check out the many examples <a href=\"https:\/\/github.com\/speedment\/speedment\">at the Speedment GitHub page<\/a>!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/www.ageofjava.com\/2016\/12\/speedment-and-spring.html\">Creating a REST API with Speedment and Spring<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Emil Forslund at the <a href=\"http:\/\/www.ageofjava.com\/\">Age of Java<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of time on the developer&#8217;s behalf is modelling an existing database in for an example Hibernate to get an object-oriented view of the data. In this tutorial we are going to &hellip;<\/p>\n","protected":false},"author":997,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[54,1330,30],"class_list":["post-62495","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-restful-web-services","tag-speedment","tag-spring"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a REST API with Speedment and Spring - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a REST API with Speedment and Spring - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-12T17:00:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Emil Forslund\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Emil Forslund\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html\"},\"author\":{\"name\":\"Emil Forslund\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/4747b94d1dd44aa972acc00feab20234\"},\"headline\":\"Creating a REST API with Speedment and Spring\",\"datePublished\":\"2016-12-12T17:00:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html\"},\"wordCount\":715,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"RESTful Web Services\",\"Speedment\",\"Spring\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html\",\"name\":\"Creating a REST API with Speedment and Spring - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2016-12-12T17:00:12+00:00\",\"description\":\"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/12\\\/creating-rest-api-speedment-spring.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Creating a REST API with Speedment and Spring\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/4747b94d1dd44aa972acc00feab20234\",\"name\":\"Emil Forslund\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g\",\"caption\":\"Emil Forslund\"},\"sameAs\":[\"https:\\\/\\\/ageofjava.blogspot.gr\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/emil-forslund\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a REST API with Speedment and Spring - Java Code Geeks","description":"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of","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:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html","og_locale":"en_US","og_type":"article","og_title":"Creating a REST API with Speedment and Spring - Java Code Geeks","og_description":"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of","og_url":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-12-12T17:00:12+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Emil Forslund","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Emil Forslund","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html"},"author":{"name":"Emil Forslund","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/4747b94d1dd44aa972acc00feab20234"},"headline":"Creating a REST API with Speedment and Spring","datePublished":"2016-12-12T17:00:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html"},"wordCount":715,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["RESTful Web Services","Speedment","Spring"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html","url":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html","name":"Creating a REST API with Speedment and Spring - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2016-12-12T17:00:12+00:00","description":"With the 4th release of Spring Boot, developing enterprise applications for the web have become so much easier. Something that still requires a lot of","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/12\/creating-rest-api-speedment-spring.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Creating a REST API with Speedment and Spring"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/4747b94d1dd44aa972acc00feab20234","name":"Emil Forslund","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/95d2e706a609a3d11417c38f6af04ec2b4da4e266fb009731cc2fb33a80708a9?s=96&d=mm&r=g","caption":"Emil Forslund"},"sameAs":["https:\/\/ageofjava.blogspot.gr\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/emil-forslund"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/62495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/997"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=62495"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/62495\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=62495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=62495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=62495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}