{"id":544,"date":"2022-10-17T10:19:32","date_gmt":"2023-06-30T17:09:03","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/"},"modified":"2025-08-01T00:27:44","modified_gmt":"2025-07-31T15:27:44","slug":"spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/","title":{"rendered":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09"},"content":{"rendered":"<p>Spring Data JPA\u306f\u3001Spring Data\u30d5\u30a1\u30df\u30ea\u30fc\u306e\u4e00\u90e8\u3067\u3059\u3002Spring Data\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u975e\u95a2\u4fc2\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30de\u30c3\u30d7\u30ea\u30c7\u30e5\u30fc\u30b9\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u306e\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\u3001\u304a\u3088\u3073\u9ad8\u5ea6\u306a\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u305fSpring\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Spring Data JPA\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u307e\u305f\u3001Spring Data JPA\u306e\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3082\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA<\/h2>\n<p>Spring Data JPA\u304c\u63d0\u4f9b\u3059\u308b\u3044\u304f\u3064\u304b\u306e\u30af\u30fc\u30eb\u306a\u6a5f\u80fd\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\uff1a<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Spring\u3068JPA\u3067\u4f5c\u6210\u3055\u308c\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4f5c\u6210\u3068\u30b5\u30dd\u30fc\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>QueryDSL\u3068JPA\u306e\u30af\u30a8\u30ea\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30c9\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306e\u76e3\u67fb\u3092\u884c\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30d0\u30c3\u30c1\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u3001\u30bd\u30fc\u30c8\u3001\u52d5\u7684\u30af\u30a8\u30ea\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u884c\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u306eXML\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>CrudRepository\u3092\u4f7f\u7528\u3057\u3066\u3001\u4e00\u822c\u7684\u306aCRUD\u64cd\u4f5c\u306e\u30b3\u30fc\u30c9\u30b5\u30a4\u30ba\u3092\u524a\u6e1b\u3057\u307e\u3059\u3002<\/ol>\n<h3>Spring Data JPA\u3092\u4f7f\u7528\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u306f\u3044\u3064\u3067\u3059\u304b\uff1f<\/h3>\n<p>\u3082\u3057\u3082CRUD\u64cd\u4f5c\u306b\u4e3b\u306b\u4f7f\u308f\u308c\u308bJPA\u30d9\u30fc\u30b9\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u5c64\u3092\u8fc5\u901f\u306b\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u62bd\u8c61\u7684\u306aDAO\u3084\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5b9f\u88c5\u3092\u4f5c\u308a\u305f\u304f\u306a\u3044\u5834\u5408\u3001Spring Data JPA\u306f\u826f\u3044\u9078\u629e\u80a2\u3060\u3068\u8a00\u3048\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>Spring Data JPA\u306e\u4f8b<\/h3>\n<p>\u79c1\u305f\u3061\u306eSpring Data JPA\u306e\u4f8b\u3067\u306f\u3001Postgresql\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308bRESTful web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306aCRUD\u64cd\u4f5c\u3092\u5b9f\u88c5\u3057\u3001\u65e2\u306b\u4f5c\u6210\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u306b\u53d6\u308a\u7d44\u3080\u4e88\u5b9a\u3067\u3059\u3002<\/p>\n<h3>\u6625\u306eJAP\u4f8b\u306e\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf<\/h3>\n<p>\u4ee5\u4e0b\u306e\u30af\u30a8\u30ea\u3092\u4f7f\u7528\u3057\u3066\u3001PostgreSQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3001\u3044\u304f\u3064\u304b\u306e\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>create table people (\r\nid serial not null primary key,\r\nfirst_name varchar(20) not null,\r\nlast_name varchar(20) not null,\r\nage integer not null\r\n);\r\n\r\ninsert into people (id, first_name, last_name, age) values\r\n(1, 'Vlad', 'Boyarskiy', 21),\r\n(2,'Oksi', ' Bahatskaya', 30),\r\n(3,'Vadim', ' Vadimich', 32);\r\n<\/code><\/pre>\n<h3>Spring Data JPA\u306eMaven\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020<\/h3>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/12-0.png\" alt=\"Spring Data JPA, Spring JPA Example\" \/><\/div>\n<h3>Spring Data JPA\u306eMaven\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n<p>\u79c1\u305f\u3061\u306eSpring Data JPA\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>postgresql: \u30dd\u30b9\u30c8\u30b0\u30ecSQL\u306eJava\u30c9\u30e9\u30a4\u30d0\u30fc\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>spring-core\u3001spring-context: Spring Framework\u306e\u30b3\u30a2\u306e\u4f9d\u5b58\u95a2\u4fc2\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>spring-webmvc\u3001jackson-databind: Spring REST\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7528\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>spring-data-jpa\u3001hibernate-entitymanager: Spring Data JPA\u3068Hibernate\u306e\u30b5\u30dd\u30fc\u30c8\u7528\u3002<\/ol>\n<p>\u4ee5\u4e0b\u306f\u6700\u7d42\u7684\u306apom.xml\u30d3\u30eb\u30c9\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;project xmlns=\"https:\/\/maven.apache.org\/POM\/4.0.0\" xmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"https:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/maven-v4_0_0.xsd\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\t&lt;groupId&gt;com.scdev&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;springData&lt;\/artifactId&gt;\r\n\t&lt;packaging&gt;war&lt;\/packaging&gt;\r\n\t&lt;version&gt;1.0-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;name&gt;Spring Data JPA Maven Webapp&lt;\/name&gt;\r\n\t&lt;url&gt;https:\/\/maven.apache.org&lt;\/url&gt;\r\n\t&lt;properties&gt;\r\n\t\t&lt;spring.framework&gt;4.3.0.RELEASE&lt;\/spring.framework&gt;\r\n\t\t&lt;postgres.version&gt;42.1.4&lt;\/postgres.version&gt;\r\n\t\t&lt;serializer.version&gt;2.8.1&lt;\/serializer.version&gt;\r\n\t\t&lt;spring.data&gt;1.3.4.RELEASE&lt;\/spring.data&gt;\r\n\t\t&lt;hibernate.manager&gt;4.2.5.Final&lt;\/hibernate.manager&gt;\r\n\t&lt;\/properties&gt;\r\n\t&lt;dependencies&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-webmvc&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${spring.framework}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.postgresql&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;postgresql&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${postgres.version}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-core&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${spring.framework}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-context&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${spring.framework}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;junit&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;junit&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;3.8.1&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;test&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.springframework.data&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;spring-data-jpa&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${spring.data}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;hibernate-entitymanager&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${hibernate.manager}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;javax.servlet&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;servlet-api&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;2.5&lt;\/version&gt;\r\n\t\t\t&lt;scope&gt;provided&lt;\/scope&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;com.fasterxml.jackson.core&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;jackson-databind&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${serializer.version}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\t&lt;\/dependencies&gt;\r\n\r\n\t&lt;build&gt;\r\n\t\t&lt;finalName&gt;${project.artifactId}&lt;\/finalName&gt;\r\n\t&lt;\/build&gt;\r\n&lt;\/project&gt;\r\n<\/code><\/pre>\n<h3>\u6625\u306e\u8a2d\u5b9a\u30af\u30e9\u30b9<\/h3>\n<pre class=\"post-pre\"><code>package com.scdev.spring.config;\r\n\r\nimport java.util.Properties;\r\n\r\nimport javax.sql.DataSource;\r\n\r\nimport org.hibernate.ejb.HibernatePersistence;\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.context.annotation.Bean;\r\nimport org.springframework.context.annotation.Configuration;\r\nimport org.springframework.context.annotation.PropertySource;\r\nimport org.springframework.core.env.Environment;\r\nimport org.springframework.data.jpa.repository.config.EnableJpaRepositories;\r\nimport org.springframework.jdbc.datasource.DriverManagerDataSource;\r\nimport org.springframework.orm.jpa.JpaTransactionManager;\r\nimport org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;\r\nimport org.springframework.transaction.annotation.EnableTransactionManagement;\r\n\r\n@Configuration\r\n@EnableTransactionManagement\r\n@EnableJpaRepositories(\"com.scdev.spring.repository\")\r\n@PropertySource(\"classpath:database.properties\")\r\npublic class DataConfig {\r\n\r\n\tprivate final String PROPERTY_DRIVER = \"driver\";\r\n\tprivate final String PROPERTY_URL = \"url\";\r\n\tprivate final String PROPERTY_USERNAME = \"user\";\r\n\tprivate final String PROPERTY_PASSWORD = \"password\";\r\n\tprivate final String PROPERTY_SHOW_SQL = \"hibernate.show_sql\";\r\n\tprivate final String PROPERTY_DIALECT = \"hibernate.dialect\";\r\n\r\n\t@Autowired\r\n\tEnvironment environment;\r\n\r\n\t@Bean\r\n\tLocalContainerEntityManagerFactoryBean entityManagerFactory() {\r\n\t\tLocalContainerEntityManagerFactoryBean lfb = new LocalContainerEntityManagerFactoryBean();\r\n\t\tlfb.setDataSource(dataSource());\r\n\t\tlfb.setPersistenceProviderClass(HibernatePersistence.class);\r\n\t\tlfb.setPackagesToScan(\"com.scdev.spring.model\");\r\n\t\tlfb.setJpaProperties(hibernateProps());\r\n\t\treturn lfb;\r\n\t}\r\n\r\n\t@Bean\r\n\tDataSource dataSource() {\r\n\t\tDriverManagerDataSource ds = new DriverManagerDataSource();\r\n\t\tds.setUrl(environment.getProperty(PROPERTY_URL));\r\n\t\tds.setUsername(environment.getProperty(PROPERTY_USERNAME));\r\n\t\tds.setPassword(environment.getProperty(PROPERTY_PASSWORD));\r\n\t\tds.setDriverClassName(environment.getProperty(PROPERTY_DRIVER));\r\n\t\treturn ds;\r\n\t}\r\n\r\n\tProperties hibernateProps() {\r\n\t\tProperties properties = new Properties();\r\n\t\tproperties.setProperty(PROPERTY_DIALECT, environment.getProperty(PROPERTY_DIALECT));\r\n\t\tproperties.setProperty(PROPERTY_SHOW_SQL, environment.getProperty(PROPERTY_SHOW_SQL));\r\n\t\treturn properties;\r\n\t}\r\n\r\n\t@Bean\r\n\tJpaTransactionManager transactionManager() {\r\n\t\tJpaTransactionManager transactionManager = new JpaTransactionManager();\r\n\t\ttransactionManager.setEntityManagerFactory(entityManagerFactory().getObject());\r\n\t\treturn transactionManager;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li>@Configuration: this spring annotation says that it is configuration class.<\/li>\n<li>@EnableTransactionManagement: this annotation allows users to use transaction management in application.<\/li>\n<li>@EnableJpaRepositories(&#8220;com.scdev.spring.repository&#8221;): indicates where the repositories classes are present.<\/li>\n<li>@PropertySource(&#8220;classpath:database.properties&#8221;): says that we have property file in our classpath. The values from this file will be injected into environment variable. The contents of the database.properties file are shown below.<br \/>\ndriver=org.postgresql.Driver<br \/>\nurl=jdbc:postgresql:\/\/127.0.0.1:5432\/postgres<br \/>\nuser=postgres<br \/>\npassword=postgreshibernate.dialect=org.hibernate.dialect.PostgreSQL82Dialect<br \/>\nhibernate.show_sql=true<\/li>\n<li>For using Spring Data, first of all we have to configure DataSource bean. Then we need to configure LocalContainerEntityManagerFactoryBean bean. We need this bean to control the entities. In this beans, you must specify the persistence provider i.e. HibernatePersistence in our case.<\/li>\n<li>The next step is to configure bean for transaction management. In our example it\u2019s JpaTransactionManager. Note that without configuring transaction manager we can\u2019t use @Transactional annotation.<\/li>\n<\/ul>\n<p>Web.xml\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u305b\u305a\u306b\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b\u305f\u3081\u306eAppInitializer\u30af\u30e9\u30b9\u3068WebConfig\u30af\u30e9\u30b9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30e2\u30c7\u30eb\u30af\u30e9\u30b9<\/h3>\n<pre class=\"post-pre\"><code>package com.scdev.spring.model;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.GenerationType;\r\nimport javax.persistence.Id;\r\nimport javax.persistence.Table;\r\n\r\n@Entity\r\n@Table(name = \"people\")\r\npublic class Person {\r\n\r\n\t@Id\r\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\r\n\tprivate Long id;\r\n\r\n\t@Column(name = \"age\")\r\n\tprivate Integer age;\r\n\t@Column(name = \"first_name\")\r\n\tprivate String firstName;\r\n\t@Column(name = \"last_name\")\r\n\tprivate String lastName;\r\n\r\n\tpublic Person() {\r\n\t}\r\n\r\n\tpublic Long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(Long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic Integer getAge() {\r\n\t\treturn age;\r\n\t}\r\n\r\n\tpublic void setAge(Integer age) {\r\n\t\tthis.age = age;\r\n\t}\r\n\r\n\tpublic String getFirstName() {\r\n\t\treturn firstName;\r\n\t}\r\n\r\n\tpublic void setFirstName(String firstName) {\r\n\t\tthis.firstName = firstName;\r\n\t}\r\n\r\n\tpublic String getLastName() {\r\n\t\treturn lastName;\r\n\t}\r\n\r\n\tpublic void setLastName(String lastName) {\r\n\t\tthis.lastName = lastName;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Person{\" + \"id=\" + id + \", age=\" + age + \", firstName='\" + firstName + '\\'' + \", lastName='\" + lastName\r\n\t\t\t\t+ '\\'' + '}';\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u306f\u3001\u3044\u304f\u3064\u304b\u306e\u65b0\u3057\u3044\u6ce8\u91c8\u304c\u3042\u308a\u307e\u3059\u3002\u3082\u3063\u3068\u8a73\u3057\u304f\u8a71\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul class=\"post-ul\">\n<li>@Entity: This annotation allows entity manager to use this class and puts it in context.<\/li>\n<li>@Table(name = \u201cpeople\u201d): associates a class with a table in the database.<\/li>\n<li>@Id: says that this field is the primary key.<\/li>\n<li>@GeneratedValue(strategy = GenerationType.IDENTITY): Defines the strategy for generating the primary key.<\/li>\n<li>@Column(name = &#8220;age&#8221;): denotes a column in the database with which this field will be associated.<\/li>\n<\/ul>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\u30ea\u30dd\u30b8\u30c8\u30ea<\/h3>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306fJPA\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.repository;\r\n\r\nimport org.springframework.data.repository.CrudRepository;\r\n\r\nimport com.scdev.spring.model.Person;\r\n\r\nimport java.util.List;\r\n\r\npublic interface PersonRepository&lt;P&gt; extends CrudRepository&lt;Person, Long&gt; {\r\n    List&lt;Person&gt; findByFirstName(String firstName);\r\n}\r\n<\/code><\/pre>\n<p>CrudRepository\u3092\u7d99\u627f\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u81ea\u5206\u3067\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u306a\u304f\u3001\u591a\u304f\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u3044\u304f\u3064\u304b\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul class=\"post-ul\">\n<li>save<\/li>\n<li>findOne<\/li>\n<li>exists<\/li>\n<li>findAll<\/li>\n<li>count<\/li>\n<li>delete<\/li>\n<li>deleteAll<\/li>\n<\/ul>\n<p>\u79c1\u305f\u3061\u306f\u72ec\u81ea\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u540d\u306f\u3001\u300cfind\u300d\u3084\u300corder\u300d\u3068\u3044\u3063\u305f\u7279\u5225\u306a\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002Spring Data JPA\u306e\u958b\u767a\u8005\u306f\u3001\u5fc5\u8981\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5927\u534a\u3092\u8003\u616e\u3057\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001findByFirstName\uff08String firstName\uff09\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u306e\u4e2d\u304b\u3089\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306efirst_name\u304cfirstName\u306b\u7b49\u3057\u3044\u3082\u306e\u3092\u5168\u3066\u8fd4\u3057\u307e\u3059\u3002\u3053\u308c\u306fSpring Data JPA\u306e\u6700\u3082\u91cd\u8981\u306a\u6a5f\u80fd\u306e\u4e00\u3064\u3067\u3042\u308a\u3001\u5927\u91cf\u306e\u5197\u9577\u306a\u30b3\u30fc\u30c9\u3092\u6e1b\u3089\u3059\u52b9\u679c\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u308c\u3089\u306eSpring\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u65e2\u306b\u591a\u304f\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306e\u4f7f\u7528\u306b\u3088\u3063\u3066\u5341\u5206\u306b\u30c6\u30b9\u30c8\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30a8\u30e9\u30fc\u306e\u53ef\u80fd\u6027\u3082\u5c11\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u6625\u306e\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9<\/h3>\n<p>\u79c1\u305f\u3061\u306eSpring Data JPA\u306e\u30b3\u30fc\u30c9\u304c\u6e96\u5099\u3067\u304d\u305f\u306e\u3067\u3001\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c6\u30fc\u30d6\u30eb\u3068\u9023\u643a\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.services;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Service;\r\nimport org.springframework.transaction.annotation.Transactional;\r\n\r\nimport com.scdev.spring.model.Person;\r\nimport com.scdev.spring.repository.PersonRepository;\r\n\r\n@Service\r\npublic class PersonService {\r\n\r\n\t@Autowired\r\n\tPersonRepository&lt;Person&gt; personRepository;\r\n\r\n\t@Transactional\r\n\tpublic List&lt;Person&gt; getAllPersons() {\r\n\t\treturn (List&lt;Person&gt;) personRepository.findAll();\r\n\t}\r\n\r\n\t@Transactional\r\n\tpublic List&lt;Person&gt; findByName(String name) {\r\n\t\treturn personRepository.findByFirstName(name);\r\n\t}\r\n\r\n\t@Transactional\r\n\tpublic Person getById(Long id) {\r\n\t\treturn personRepository.findOne(id);\r\n\t}\r\n\r\n\t@Transactional\r\n\tpublic void deletePerson(Long personId) {\r\n\t\tpersonRepository.delete(personId);\r\n\t}\r\n\r\n\t@Transactional\r\n\tpublic boolean addPerson(Person person) {\r\n\t\treturn personRepository.save(person) != null;\r\n\t}\r\n\r\n\t@Transactional\r\n\tpublic boolean updatePerson(Person person) {\r\n\t\treturn personRepository.save(person) != null;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>@Transactional\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u5185\u3067\u5b9f\u884c\u3055\u308c\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002Spring\u306f\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3092\u62c5\u5f53\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30af\u30e9\u30b9<\/h3>\n<p>\u6700\u5f8c\u306e\u30b9\u30c6\u30c3\u30d7\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u3066\u3001\u5916\u90e8\u306e\u4e16\u754c\u306bAPI\u3092\u516c\u958b\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.spring.controller;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.http.HttpStatus;\r\nimport org.springframework.web.bind.annotation.PathVariable;\r\nimport org.springframework.web.bind.annotation.RequestBody;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.bind.annotation.ResponseBody;\r\nimport org.springframework.web.bind.annotation.RestController;\r\n\r\nimport com.scdev.spring.model.Person;\r\nimport com.scdev.spring.services.PersonService;\r\n\r\n@RestController\r\npublic class PersonController {\r\n\r\n\t@Autowired\r\n\tPersonService personService;\r\n\r\n\t@RequestMapping(value = \"\/person\/{id}\", method = RequestMethod.GET)\r\n\tpublic @ResponseBody Person getAllUsers(@PathVariable Long id) {\r\n\t\treturn personService.getById(id);\r\n\t}\r\n\r\n\t@RequestMapping(value = \"\/personByName\/{name}\", method = RequestMethod.GET)\r\n\tpublic List&lt;Person&gt; getPersoneByName(@PathVariable String name) {\r\n\t\treturn personService.findByName(name);\r\n\t}\r\n\r\n\t@RequestMapping(value = \"\/person\", method = RequestMethod.GET)\r\n\tpublic List&lt;Person&gt; getAll() {\r\n\t\treturn personService.getAllPersons();\r\n\t}\r\n\r\n\t@RequestMapping(value = \"\/person\/{id}\", method = RequestMethod.DELETE)\r\n\tpublic HttpStatus deletePersnone(@PathVariable Long id) {\r\n\t\tpersonService.deletePerson(id);\r\n\t\treturn HttpStatus.NO_CONTENT;\r\n\t}\r\n\r\n\t@RequestMapping(value = \"\/person\", method = RequestMethod.POST)\r\n\tpublic HttpStatus insertPersone(@RequestBody Person person) {\r\n\t\treturn personService.addPerson(person) ? HttpStatus.CREATED : HttpStatus.BAD_REQUEST;\r\n\t}\r\n\r\n\t@RequestMapping(value = \"\/person\", method = RequestMethod.PUT)\r\n\tpublic HttpStatus updatePerson(@RequestBody Person person) {\r\n\t\treturn personService.updatePerson(person) ? HttpStatus.ACCEPTED : HttpStatus.BAD_REQUEST;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<h3>Spring Data JPA\u306e\u30c6\u30b9\u30c8<\/h3>\n<p>\u597d\u304d\u306aServlet\u30b3\u30f3\u30c6\u30ca\uff08\u4f8b\uff1aTomcat\uff09\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30d3\u30eb\u30c9\u3057\u3066\u5c55\u958b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4ee5\u4e0b\u306e\u753b\u50cf\u306f\u3001\u3044\u304f\u3064\u304b\u306eAPI\u547c\u3073\u51fa\u3057\u306b\u5bfe\u3059\u308b\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h5>Spring Data JPA\u306e\u5168\u3066\u3092\u8aad\u307f\u53d6\u308b\u3002<\/h5>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/42-0.png\" alt=\"Spring Data JPA Example Read All\" \/><\/div>\n<h5>Spring Data JPA\u3067\u540d\u524d\u3067\u691c\u7d22\u3059\u308b<\/h5>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/44-0.png\" alt=\"Spring JPA Read\" \/><\/div>\n<h5>Spring Data JPA \u306e\u4f5c\u6210<\/h5>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/46-0.png\" alt=\"Spring Data JPA Create\" \/><\/div>\n<h5>Spring Data JPA\u306e\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8<\/h5>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/48-0.png\" alt=\"Spring Data JPA Update\" \/><\/div>\n<h5>Spring Data JPA\u306e\u524a\u9664<\/h5>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/50-0.png\" alt=\"Spring Data JPA Example Delete\" \/><\/div>\n<p>\u300cSpring Data JPA\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d<\/p>\n<p>\u53c2\u8003: \u516c\u5f0f\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Data JPA\u306f\u3001Spring Data\u30d5\u30a1\u30df\u30ea\u30fc\u306e\u4e00\u90e8\u3067\u3059\u3002Spring Data\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u975e\u95a2\u4fc2\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30de\u30c3\u30d7\u30ea\u30c7\u30e5\u30fc\u30b9\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u306a\u3069\u306e\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\u3001\u304a\u3088\u3073 [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\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.silicloud.com\/ja\/blog\/spring-data-jpa\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfjpa\uff09\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\" \/>\n<meta property=\"og:description\" content=\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfjpa\uff09\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-30T17:09:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T15:27:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/12-0.png\" \/>\n<meta name=\"author\" content=\"\u84ee, \u7ffc\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u84ee, \u7ffc\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"34\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/\",\"name\":\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-06-30T17:09:03+00:00\",\"dateModified\":\"2025-07-31T15:27:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\"},\"description\":\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413\",\"name\":\"\u84ee, \u7ffc\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g\",\"caption\":\"\u84ee, \u7ffc\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09 - Blog - Silicon Cloud","description":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","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.silicloud.com\/ja\/blog\/spring-data-jpa\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfjpa\uff09\/","og_locale":"ja_JP","og_type":"article","og_title":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09","og_description":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfjpa\uff09\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-30T17:09:03+00:00","article_modified_time":"2025-07-31T15:27:44+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/656490fbdaa94e2bdf7be1bc\/12-0.png"}],"author":"\u84ee, \u7ffc","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u84ee, \u7ffc","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"34\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/","name":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-06-30T17:09:03+00:00","dateModified":"2025-07-31T15:27:44+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413"},"description":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring Data JPA\uff08\u30b9\u30d7\u30ea\u30f3\u30b0\u30c7\u30fc\u30bfJPA\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cdc124a0aaebf26393d8d591183ca413","name":"\u84ee, \u7ffc","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/27308f733c7fcdac8617926a0100c77213339c4e501310a08c0baf946bf823bc?s=96&d=mm&r=g","caption":"\u84ee, \u7ffc"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/rentsubasa\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-data-jpa%ef%bc%88%e3%82%b9%e3%83%97%e3%83%aa%e3%83%b3%e3%82%b0%e3%83%87%e3%83%bc%e3%82%bfjpa%ef%bc%89\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":41965,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/544\/revisions\/41965"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}