{"id":562,"date":"2023-10-14T05:54:27","date_gmt":"2023-06-04T23:47:22","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/"},"modified":"2025-08-01T00:37:29","modified_gmt":"2025-07-31T15:37:29","slug":"spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/","title":{"rendered":"Spring ORM\u306e\u4f8b &#8211; JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3"},"content":{"rendered":"<p>\u300cSpring ORM\u306e\u4f8b\u984c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002\u4eca\u65e5\u306fHibernate JPA\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3092\u4f7f\u7528\u3057\u305fSpring ORM\u306e\u4f8b\u984c\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u6301\u3064\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306aSpring\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\u300d<\/p>\n<ul class=\"post-ul\">\n<li>Dependency Injection (@Autowired annotation)<\/li>\n<li>JPA EntityManager (provided by Hibernate)<\/li>\n<li>Annotated transactional methods (@Transactional annotation)<\/li>\n<\/ul>\n<h2>Spring ORM\u306e\u4f8b\u793a<\/h2>\n<p>\u79c1\u306fSpring ORM\u306e\u4f8b\u3067\u30a4\u30f3\u30e1\u30e2\u30ea\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\uff08\u305f\u3060\u3057\u3001spring.xml\u306edatasource\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u5225\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\uff09\u3002\u3053\u308c\u306f\u4f9d\u5b58\u95a2\u4fc2\u3092\u6700\u5c0f\u9650\u306b\u6291\u3048\u305fSpring ORM\u306e\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed\u30f3\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3059\uff08\u305f\u3060\u3057\u3001Spring\u306b\u6163\u308c\u308c\u3070\u7c21\u5358\u306b\u30a6\u30a7\u30d6\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5909\u66f4\u3067\u304d\u307e\u3059\uff09\u3002\u6ce8\uff1a@Transactional\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306a\u3057\u3067Spring AOP\u30d9\u30fc\u30b9\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u51e6\u7406\u65b9\u6cd5\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\uff1aSpring ORM AOP\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3002\u4ee5\u4e0b\u306e\u753b\u50cf\u306f\u3001\u6700\u7d42\u7684\u306aSpring ORM\u306e\u4f8b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u308c\u3067\u306f\u3001Spring ORM\u306e\u4f8b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5404\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3064\u3044\u3066\u4e00\u3064\u4e00\u3064\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>Spring ORM Maven\u306e\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n<p>\u4ee5\u4e0b\u306f\u3001Spring ORM\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u6301\u3064\u79c1\u305f\u3061\u306e\u6700\u7d42\u7684\u306apom.xml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u79c1\u305f\u3061\u306f\u3001Spring 4\u3068Hibernate 4\u3092Spring ORM\u306e\u4f8b\u3067\u4f7f\u7528\u3057\u307e\u3057\u305f\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\" xsi:schemaLocation=\"https:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n\t&lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n\r\n\t&lt;groupId&gt;hu.daniel.hari.learn.spring&lt;\/groupId&gt;\r\n\t&lt;artifactId&gt;Tutorial-SpringORMwithTX&lt;\/artifactId&gt;\r\n\t&lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n\t&lt;packaging&gt;jar&lt;\/packaging&gt;\r\n\r\n\t&lt;properties&gt;\r\n\t\t&lt;!-- Generic properties --&gt;\r\n\t\t&lt;project.build.sourceEncoding&gt;UTF-8&lt;\/project.build.sourceEncoding&gt;\r\n\t\t&lt;java.version&gt;1.7&lt;\/java.version&gt;\r\n\r\n\t\t&lt;!-- SPRING &amp; HIBERNATE \/ JPA --&gt;\r\n\t\t&lt;spring.version&gt;4.0.0.RELEASE&lt;\/spring.version&gt;\r\n\t\t&lt;hibernate.version&gt;4.1.9.Final&lt;\/hibernate.version&gt;\r\n\r\n\t&lt;\/properties&gt;\r\n\r\n\t&lt;dependencies&gt;\r\n\t\t&lt;!-- LOG --&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;log4j&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;log4j&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;1.2.17&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;!-- Spring --&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.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-orm&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;${spring.version}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;!-- JPA Vendor --&gt;\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.version}&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t\t&lt;!-- IN MEMORY Database and JDBC Driver --&gt;\r\n\t\t&lt;dependency&gt;\r\n\t\t\t&lt;groupId&gt;hsqldb&lt;\/groupId&gt;\r\n\t\t\t&lt;artifactId&gt;hsqldb&lt;\/artifactId&gt;\r\n\t\t\t&lt;version&gt;1.8.0.7&lt;\/version&gt;\r\n\t\t&lt;\/dependency&gt;\r\n\r\n\t&lt;\/dependencies&gt;\r\n\r\n\t&lt;build&gt;\r\n\t\t&lt;plugins&gt;\r\n\t\t\t&lt;plugin&gt;\r\n\t\t\t\t&lt;groupId&gt;org.apache.maven.plugins&lt;\/groupId&gt;\r\n\t\t\t\t&lt;artifactId&gt;maven-compiler-plugin&lt;\/artifactId&gt;\r\n\t\t\t\t&lt;version&gt;3.1&lt;\/version&gt;\r\n\t\t\t\t&lt;configuration&gt;\r\n\t\t\t\t\t&lt;source&gt;${java.version}&lt;\/source&gt;\r\n\t\t\t\t\t&lt;target&gt;${java.version}&lt;\/target&gt;\r\n\t\t\t\t&lt;\/configuration&gt;\r\n\t\t\t&lt;\/plugin&gt;\r\n\t\t&lt;\/plugins&gt;\r\n\t&lt;\/build&gt;\r\n\r\n&lt;\/project&gt;\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li>We need spring-context and spring-orm as Spring dependencies.<\/li>\n<li>We use hibernate-entitymanager for Hibernate as JPA implementation. hibernate-entitymanager is dependent on hibernate-core this why we don\u2019t have to put hibernate-core in pom.xml explicitly. It\u2019s being pulled into our project through maven transitive dependencies.<\/li>\n<li>We also need JDBC driver as dependency for database access. We are using HSQLDB that contains the JDBC driver and a working in memory database.<\/li>\n<\/ul>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0 ORM \u30e2\u30c7\u30eb\u30af\u30e9\u30b9<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u3001\u30e2\u30c7\u30eb\u30d3\u30fc\u30f3\u3067\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306b\u306f\u6a19\u6e96\u306eJPA\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u306a\u305c\u306a\u3089\u3001Hibernate\u306fJPA\u306e\u5b9f\u88c5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package hu.daniel.hari.learn.spring.orm.model;\r\n\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.Id;\r\n\r\n@Entity\r\npublic class Product {\r\n\r\n\t@Id\r\n\tprivate Integer id;\r\n\tprivate String name;\r\n\r\n\tpublic Product() {\r\n\t}\r\n\r\n\tpublic Product(Integer id, String name) {\r\n\t\tthis.id = id;\r\n\t\tthis.name = name;\r\n\t}\r\n\tpublic Integer getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(Integer id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn \"Product [id=\" + id + \", name=\" + name + \"]\";\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u79c1\u305f\u3061\u306f\u3001POJO\u3092\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3001\u305d\u306e\u4e3b\u30ad\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u3001@Entity\u3068@Id\u306eJPA\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u6625\u306eORM\u306eDAO\u30af\u30e9\u30b9<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u3001\u6c38\u7d9a\u6027\u3068\u691c\u7d22\u306e\u305f\u3081\u306e\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306aDAO\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package hu.daniel.hari.learn.spring.orm.dao;\r\n\r\nimport hu.daniel.hari.learn.spring.orm.model.Product;\r\n\r\nimport java.util.List;\r\n\r\nimport javax.persistence.EntityManager;\r\nimport javax.persistence.PersistenceContext;\r\n\r\nimport org.springframework.stereotype.Component;\r\n\r\n@Component\r\npublic class ProductDao {\r\n\r\n\t@PersistenceContext\r\n\tprivate EntityManager em;\r\n\r\n\tpublic void persist(Product product) {\r\n\t\tem.persist(product);\r\n\t}\r\n\r\n\tpublic List&lt;Product&gt; findAll() {\r\n\t\treturn em.createQuery(\"SELECT p FROM Product p\").getResultList();\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li>@Component is Spring annotation that tell the Spring container that we can use this class through Spring IoC (Dependency Injection).<\/li>\n<li>We use JPA @PersistenceContext annotation that indicate dependency injection to an EntityManager. Spring injects a proper instance of EntityManager according to the spring.xml configuration.<\/li>\n<\/ul>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0\u306eORM\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9<\/h3>\n<p>\u79c1\u305f\u3061\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u306b\u306f\u3001add\u3068addAll\u3068\u3044\u30462\u3064\u306e\u66f8\u304d\u8fbc\u307f\u30e1\u30bd\u30c3\u30c9\u3068listAll\u3068\u3044\u30461\u3064\u306e\u8aad\u307f\u53d6\u308a\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package hu.daniel.hari.learn.spring.orm.service;\r\n\r\nimport hu.daniel.hari.learn.spring.orm.dao.ProductDao;\r\nimport hu.daniel.hari.learn.spring.orm.model.Product;\r\n\r\nimport java.util.Collection;\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Component;\r\nimport org.springframework.transaction.annotation.Transactional;\r\n\r\n@Component\r\npublic class ProductService {\r\n\r\n\t@Autowired\r\n\tprivate ProductDao productDao;\r\n\r\n\t@Transactional\r\n\tpublic void add(Product product) {\r\n\t\tproductDao.persist(product);\r\n\t}\r\n\t\r\n\t@Transactional\r\n\tpublic void addAll(Collection&lt;Product&gt; products) {\r\n\t\tfor (Product product : products) {\r\n\t\t\tproductDao.persist(product);\r\n\t\t}\r\n\t}\r\n\r\n\t@Transactional(readOnly = true)\r\n\tpublic List&lt;Product&gt; listAll() {\r\n\t\treturn productDao.findAll();\r\n\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<ul class=\"post-ul\">\n<li>We use Spring @Autowired annotation to inject ProductDao in our service class.<\/li>\n<li>We want to use transaction management, so methods are annotated with @Transactional Spring annotation. The listAll method only reads the database so we set the @Transactional annotation to read-only for optimisation.<\/li>\n<\/ul>\n<h3>Spring ORM\u306e\u4f8b\u306eBean\u8a2d\u5b9aXML<\/h3>\n<p>\u79c1\u305f\u3061\u306eSpring ORM\u306e\u4f8b\u984c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eJava\u30af\u30e9\u30b9\u306f\u6e96\u5099\u304c\u3067\u304d\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u4eca\u306fSpring\u306eBean\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002spring.xml<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;beans xmlns=\"https:\/\/www.springframework.org\/schema\/beans\" \r\n\txmlns:p=\"https:\/\/www.springframework.org\/schema\/p\"\r\n\txmlns:context=\"https:\/\/www.springframework.org\/schema\/context\" \r\n\txmlns:tx=\"https:\/\/www.springframework.org\/schema\/tx\" \r\n\txmlns:xsi=\"https:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n\txsi:schemaLocation=\"\r\n\t\thttps:\/\/www.springframework.org\/schema\/beans\r\n\t\thttps:\/\/www.springframework.org\/schema\/beans\/spring-beans-3.0.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/context\r\n\t\thttps:\/\/www.springframework.org\/schema\/context\/spring-context-3.0.xsd\r\n\t\thttps:\/\/www.springframework.org\/schema\/tx\r\n\t\thttps:\/\/www.springframework.org\/schema\/tx\/spring-tx.xsd\r\n\t\t\"&gt;\r\n\t\r\n\t&lt;!-- Scans the classpath for annotated components that will be auto-registered as Spring beans --&gt;\r\n\t&lt;context:component-scan base-package=\"hu.daniel.hari.learn.spring\" \/&gt;\r\n\t&lt;!-- Activates various annotations to be detected in bean classes e.g: @Autowired --&gt;\r\n\t&lt;context:annotation-config \/&gt;\r\n\r\n\t&lt;bean id=\"dataSource\" class=\"org.springframework.jdbc.datasource.DriverManagerDataSource\"&gt;\r\n\t\t&lt;property name=\"driverClassName\" value=\"org.hsqldb.jdbcDriver\" \/&gt;\r\n\t\t&lt;property name=\"url\" value=\"jdbc:hsqldb:mem:\/\/productDb\" \/&gt;\r\n\t\t&lt;property name=\"username\" value=\"sa\" \/&gt;\r\n\t\t&lt;property name=\"password\" value=\"\" \/&gt;\r\n\t&lt;\/bean&gt;\r\n\t\r\n\t&lt;bean id=\"entityManagerFactory\" \r\n\t\t\tclass=\"org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean\"\r\n\t\t\tp:packagesToScan=\"hu.daniel.hari.learn.spring.orm.model\"\r\n            p:dataSource-ref=\"dataSource\"\r\n\t\t\t&gt;\r\n\t\t&lt;property name=\"jpaVendorAdapter\"&gt;\r\n\t\t\t&lt;bean class=\"org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter\"&gt;\r\n\t\t\t\t&lt;property name=\"generateDdl\" value=\"true\" \/&gt;\r\n\t\t\t\t&lt;property name=\"showSql\" value=\"true\" \/&gt;\r\n\t\t\t&lt;\/bean&gt;\r\n\t\t&lt;\/property&gt;\r\n\t&lt;\/bean&gt;\r\n\r\n\t&lt;!-- Transactions --&gt;\r\n\t&lt;bean id=\"transactionManager\" class=\"org.springframework.orm.jpa.JpaTransactionManager\"&gt;\r\n\t\t&lt;property name=\"entityManagerFactory\" ref=\"entityManagerFactory\" \/&gt;\r\n\t&lt;\/bean&gt;\r\n\t&lt;!-- enable the configuration of transactional behavior based on annotations --&gt;\r\n\t&lt;tx:annotation-driven transaction-manager=\"transactionManager\" \/&gt;\r\n\r\n&lt;\/beans&gt;\r\n<\/code><\/pre>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u6700\u521d\u306b\u3001Spring\u306b\u5bfe\u3057\u3066\u3001Spring\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff08\u30b5\u30fc\u30d3\u30b9\u3001DAO\uff09\u306e\u30af\u30e9\u30b9\u30d1\u30b9\u30b9\u30ad\u30e3\u30f3\u3092\u884c\u3044\u3001spring xml\u3067\u500b\u5225\u306b\u5b9a\u7fa9\u3059\u308b\u4ee3\u308f\u308a\u306b\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u4f1d\u3048\u307e\u3059\u3002\u307e\u305f\u3001Spring\u306e\u6ce8\u91c8\u306e\u691c\u51fa\u3082\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u6b21\u306b\u3001\u73fe\u5728\u306eHSQLDB\u30a4\u30f3\u30e1\u30e2\u30ea\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304cEntityManager\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3059\u308bJPA EntityManagerFactory\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002Spring\u306f\u3053\u308c\u3092\u884c\u3046\u305f\u3081\u306e3\u3064\u306e\u7570\u306a\u308b\u65b9\u6cd5\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u30d5\u30eb\u306eJPA\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306b\u3001LocalContainerEntityManagerFactoryBean\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002LocalContainerEntityManagerFactoryBean\u306e\u5c5e\u6027\u3092\u6b21\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u30b9\u30ad\u30e3\u30f3\u5c5e\u6027\u306f\u3001\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6307\u3059\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u524d\u8ff0\u306e\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u306f\u3001spring\u306e\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3067\u5b9a\u7fa9\u3057\u307e\u3059\u3002<br \/>\njpaVendorAdapter\u306fHibernate\u3092\u4f7f\u7528\u3057\u3001\u3044\u304f\u3064\u304b\u306eHibernate\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001JpaTransactionManager\u3068\u3057\u3066Spring\u306ePlatformTransactionManager\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30de\u30cd\u30fc\u30b8\u30e3\u306f\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30c7\u30fc\u30bf\u30a2\u30af\u30bb\u30b9\u306b\u5358\u4e00\u306eJPA EntityManagerFactory\u3092\u4f7f\u7528\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306b\u57fa\u3065\u304f\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u52d5\u4f5c\u306e\u69cb\u6210\u3092\u6709\u52b9\u306b\u3057\u3001\u4f5c\u6210\u3057\u305ftransactionManager\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30b9\u30d7\u30ea\u30f3\u30b0ORM\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8JPA\u306e\u5b9f\u4f8b\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0<\/h3>\n<p>\u79c1\u305f\u3061\u306eSpring ORM JPA Hibernate\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u6e96\u5099\u3067\u304d\u305f\u306e\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>public class SpringOrmMain {\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\t\r\n\t\t\/\/Create Spring application context\r\n\t\tClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(\"classpath:\/spring.xml\");\r\n\t\t\r\n\t\t\/\/Get service from context. (service's dependency (ProductDAO) is autowired in ProductService)\r\n\t\tProductService productService = ctx.getBean(ProductService.class);\r\n\t\t\r\n\t\t\/\/Do some data operation\r\n\t\t\r\n\t\tproductService.add(new Product(1, \"Bulb\"));\r\n\t\tproductService.add(new Product(2, \"Dijone mustard\"));\r\n\t\t\r\n\t\tSystem.out.println(\"listAll: \" + productService.listAll());\r\n\t\t\r\n\t\t\/\/Test transaction rollback (duplicated key)\r\n\t\t\r\n\t\ttry {\r\n\t\t\tproductService.addAll(Arrays.asList(new Product(3, \"Book\"), new Product(4, \"Soap\"), new Product(1, \"Computer\")));\r\n\t\t} catch (DataAccessException dataAccessException) {\r\n\t\t}\r\n\t\t\r\n\t\t\/\/Test element list after rollback\r\n\t\tSystem.out.println(\"listAll: \" + productService.listAll());\r\n\t\t\r\n\t\tctx.close();\r\n\t\t\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>\u30e1\u30a4\u30f3\u30e1\u30bd\u30c3\u30c9\u304b\u3089Spring\u30b3\u30f3\u30c6\u30ca\u3092\u7c21\u5358\u306b\u8d77\u52d5\u3067\u304d\u308b\u65b9\u6cd5\u304c\u308f\u304b\u308a\u307e\u3059\u3002\u6700\u521d\u306b\u4f9d\u5b58\u6027\u306e\u6ce8\u5165\u3055\u308c\u305f\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3067\u3042\u308b\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002Spring\u306e\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u304c\u521d\u671f\u5316\u3055\u308c\u305f\u5f8c\u3001ProductDao\u30af\u30e9\u30b9\u3078\u306e\u53c2\u7167\u304cProductService\u30af\u30e9\u30b9\u306b\u6ce8\u5165\u3055\u308c\u307e\u3059\u3002ProducService\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u53d6\u5f97\u3057\u305f\u5f8c\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u30c6\u30b9\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306f\u3001Spring\u306e\u30d7\u30ed\u30ad\u30b7\u30e1\u30ab\u30cb\u30ba\u30e0\u306b\u3088\u308a\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3068\u3057\u3066\u51e6\u7406\u3055\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u306e\u4f8b\u3067\u306f\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3082\u30c6\u30b9\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u4e0a\u8a18\u306eSpring ORM\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>Hibernate: insert into Product (name, id) values (?, ?)\r\nHibernate: insert into Product (name, id) values (?, ?)\r\nHibernate: select product0_.id as id0_, product0_.name as name0_ from Product product0_\r\nlistAll: [Product [id=1, name=Bulb], Product [id=2, name=Dijone mustard]]\r\nHibernate: insert into Product (name, id) values (?, ?)\r\nHibernate: insert into Product (name, id) values (?, ?)\r\nHibernate: insert into Product (name, id) values (?, ?)\r\nHibernate: select product0_.id as id0_, product0_.name as name0_ from Product product0_\r\nlistAll: [Product [id=1, name=Bulb], Product [id=2, name=Dijone mustard]]\r\n<\/code><\/pre>\n<p>\u7b2c2\u306e\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u304c\u30ed\u30fc\u30eb\u30d0\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u88fd\u54c1\u30ea\u30b9\u30c8\u306f\u5909\u66f4\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u6dfb\u4ed8\u3055\u308c\u305f\u30bd\u30fc\u30b9\u304b\u3089log4j.properties\u30d5\u30a1\u30a4\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u5185\u90e8\u3067\u4f55\u304c\u8d77\u3053\u3063\u3066\u3044\u308b\u304b\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u53c2\u8003\u6587\u732e\uff1ahttps:\/\/docs.spring.io\/spring\/docs\/current\/spring-framework-reference\/html\/orm.html \u6700\u7d42\u7684\u306aSpring ORM JPA Hibernate\u306e\u4f8b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001\u305d\u308c\u3092\u64cd\u4f5c\u3057\u3066\u5b66\u7fd2\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30d7\u30ea\u30f3\u30b0\u306eORM\u3068\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u300cSpring ORM\u306e\u4f8b\u984c\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002\u4eca\u65e5\u306fHibernate JPA\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3092\u4f7f\u7528\u3057\u305fSpring ORM\u306e\u4f8b\u984c\u306b\u3064\u3044\u3066\u898b\u3066\u3044\u304d\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u6a5f\u80fd\u3092\u6301\u3064\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u306aSpring\u30b9\u30bf\u30f3\u30c9\u30a2\u30ed [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-562","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 ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm\u306e\u4f8b-jpa\u3001hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\" \/>\n<meta property=\"og:description\" content=\"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm\u306e\u4f8b-jpa\u3001hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-04T23:47:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T15:37:29+00:00\" \/>\n<meta name=\"author\" content=\"\u82bd\u4f9d, \u96e8\u591c\" \/>\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=\"\u82bd\u4f9d, \u96e8\u591c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"27\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-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/\",\"name\":\"Spring ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-06-04T23:47:22+00:00\",\"dateModified\":\"2025-07-31T15:37:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27\"},\"description\":\"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring ORM\u306e\u4f8b &#8211; JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\"}]},{\"@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\/aeb60a7861f2f002b54c66bd65bc6c27\",\"name\":\"\u82bd\u4f9d, \u96e8\u591c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g\",\"caption\":\"\u82bd\u4f9d, \u96e8\u591c\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/meiamaya\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Spring ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3 - Blog - Silicon Cloud","description":"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm\u306e\u4f8b-jpa\u3001hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\/","og_locale":"ja_JP","og_type":"article","og_title":"Spring ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3","og_description":"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm\u306e\u4f8b-jpa\u3001hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-06-04T23:47:22+00:00","article_modified_time":"2025-07-31T15:37:29+00:00","author":"\u82bd\u4f9d, \u96e8\u591c","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u82bd\u4f9d, \u96e8\u591c","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"27\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/","name":"Spring ORM\u306e\u4f8b - JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-06-04T23:47:22+00:00","dateModified":"2025-07-31T15:37:29+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/aeb60a7861f2f002b54c66bd65bc6c27"},"description":"Spring ORM\u306e\u4f8b - JPAHibernate\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\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-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Spring ORM\u306e\u4f8b &#8211; JPA\u3001Hibernate\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3"}]},{"@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\/aeb60a7861f2f002b54c66bd65bc6c27","name":"\u82bd\u4f9d, \u96e8\u591c","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6305fe5cabc2b854c1208975a47fbf3f8cef3f7cd775b94dceedbe59b74a8010?s=96&d=mm&r=g","caption":"\u82bd\u4f9d, \u96e8\u591c"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/meiamaya\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/spring-orm%e3%81%ae%e4%be%8b-jpa%e3%80%81hibernate%e3%80%81%e3%83%88%e3%83%a9%e3%83%b3%e3%82%b6%e3%82%af%e3%82%b7%e3%83%a7%e3%83%b3\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/562","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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=562"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions"}],"predecessor-version":[{"id":42191,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/562\/revisions\/42191"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}