{"id":711,"date":"2023-01-07T05:17:32","date_gmt":"2023-12-06T07:37:35","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"},"modified":"2025-08-01T01:51:23","modified_gmt":"2025-07-31T16:51:23","slug":"%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","title":{"rendered":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"},"content":{"rendered":"<p>\u521d\u5fc3\u8005\u306e\u305f\u3081\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002Hibernate\u306f\u3001\u6700\u3082\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u308bJava\u306eORM\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3059\u3002\u307b\u3068\u3093\u3069\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u4fdd\u5b58\u3057\u3001\u4f4e\u30ec\u30d9\u30eb\u3067\u306fJDBC API\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3057\u3001CRUD\u64cd\u4f5c\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<h2>\u521d\u5fc3\u8005\u306e\u305f\u3081\u306e\u30d2\u30d9\u30eb\u30cd\u30fc\u30c8\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb<\/h2>\n<p>JDBC\u306e\u30b3\u30fc\u30c9\u3092\u898b\u308b\u3068\u3001\u5927\u91cf\u306e\u5b9a\u578b\u30b3\u30fc\u30c9\u304c\u3042\u308a\u3001\u30ea\u30bd\u30fc\u30b9\u306e\u6f0f\u6d29\u3084\u30c7\u30fc\u30bf\u306e\u4e0d\u6574\u5408\u306e\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u3059\u3079\u3066\u306e\u4f5c\u696d\u304c\u958b\u767a\u8005\u306b\u3088\u3063\u3066\u884c\u308f\u308c\u308b\u305f\u3081\u3067\u3059\u3002\u3053\u3053\u304cORM\u30c4\u30fc\u30eb\u306e\u5f79\u5272\u3067\u3059\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u95a2\u4fc2\u30de\u30c3\u30d4\u30f3\u30b0\uff08ORM\uff09\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c9\u30e1\u30a4\u30f3\u30e2\u30c7\u30eb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u95a2\u4fc2\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u6280\u8853\u3067\u3059\u3002Hibernate\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30c9\u30e1\u30a4\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u95a2\u4fc2\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u9006\u3082\u884c\u3046Java\u30d9\u30fc\u30b9\u306eORM\u30c4\u30fc\u30eb\u3067\u3059\u3002Hibernate\u3092ORM\u30c4\u30fc\u30eb\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u3053\u3068\u306e\u3044\u304f\u3064\u304b\u306e\u5229\u70b9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u3001Java\u306e\u30af\u30e9\u30b9\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u3001\u305d\u306e\u9006\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u4e3b\u8981\u306a\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u5168\u4f53\u3067CRUD\u64cd\u4f5c\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3082\u63d0\u4f9b\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>Hibernate\u306f\u3001JDBC\u306b\u4ed8\u968f\u3059\u308b\u5197\u9577\u306a\u30b3\u30fc\u30c9\u3092\u6392\u9664\u3057\u3001\u30ea\u30bd\u30fc\u30b9\u306e\u7ba1\u7406\u306b\u3082\u6c17\u3092\u914d\u3063\u3066\u304f\u308c\u308b\u305f\u3081\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u304c\u30ea\u30bd\u30fc\u30b9\u306e\u6f0f\u6d29\u3092\u5f15\u304d\u8d77\u3053\u3057\u3066\u3044\u306a\u3044\u304b\u3092\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u3092\u8003\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001\u30d3\u30b8\u30cd\u30b9\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9\u306b\u96c6\u4e2d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u5185\u306b\u4e00\u8cab\u6027\u306e\u306a\u3044\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Java\u306e\u30af\u30e9\u30b9\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u305f\u3081\u306b\u3001XML\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u9593\u306b\u62bd\u8c61\u5316\u5c64\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u3001\u7d50\u5408\u3001\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3001\u7d99\u627f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3001\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u3069\u306e\u3088\u3046\u306b\u8868\u3057\u3066\u3044\u308b\u304b\u3092\u7c21\u5358\u306b\u53ef\u8996\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u3001SQL\u306b\u4f3c\u305f\u30d1\u30ef\u30d5\u30eb\u306a\u30af\u30a8\u30ea\u8a00\u8a9e\uff08HQL\uff09\u3082\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u305f\u3060\u3057\u3001HQL\u306f\u5b8c\u5168\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3067\u3042\u308a\u3001\u7d99\u627f\u3001\u591a\u614b\u6027\u3001\u95a2\u9023\u6027\u306a\u3069\u306e\u6982\u5ff5\u3092\u7406\u89e3\u3057\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u3001\u5916\u90e8\u30e2\u30b8\u30e5\u30fc\u30eb\u3068\u306e\u7d71\u5408\u3082\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001Hibernate Validator\u306fBean Validation\uff08JSR 303\uff09\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u5b9f\u88c5\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Hibernate\u306f\u3001Red Hat Community\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308a\u3001\u4e16\u754c\u4e2d\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u5b66\u7fd2\u66f2\u7dda\u304c\u5c0f\u3055\u304f\u3001\u30aa\u30f3\u30e9\u30a4\u30f3\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u8c4a\u5bcc\u3067\u3001\u30d5\u30a9\u30fc\u30e9\u30e0\u3067\u306e\u30d8\u30eb\u30d7\u3082\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u308b\u305f\u3081\u3001\u4ed6\u306e\u9078\u629e\u80a2\u3088\u308a\u3082\u512a\u308c\u305f\u9078\u629e\u80a2\u3068\u306a\u308a\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>Hibernate\u306f\u4ed6\u306eJava EE\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u7c21\u5358\u306b\u7d71\u5408\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001Spring Framework\u3067\u306fHibernate\u3092Spring\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u7d71\u5408\u3059\u308b\u305f\u3081\u306e\u7d44\u307f\u8fbc\u307f\u30b5\u30dd\u30fc\u30c8\u3082\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/ol>\n<p>\u4e0a\u8a18\u306e\u5229\u70b9\u304c\u3059\u3079\u3066\u3042\u306a\u305f\u3092\u7d0d\u5f97\u3055\u305b\u3001Hibernate\u304c\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30de\u30c3\u30d4\u30f3\u30b0\u8981\u4ef6\u306b\u304a\u3044\u3066\u6700\u826f\u306e\u9078\u629e\u80a2\u3067\u3042\u308b\u3053\u3068\u3092\u9858\u3063\u3066\u3044\u307e\u3059\u3002\u3067\u306f\u3001Hibernate\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3092\u898b\u3066\u3001\u305d\u308c\u304b\u3089\u72ec\u7acb\u3057\u305fJava\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067Hibernate\u3092\u8a2d\u5b9a\u3057\u4f7f\u7528\u3059\u308b\u3055\u307e\u3056\u307e\u306a\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30d2\u30d0\u30cd\u30fc\u30c8\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3<\/h3>\n<p>\u4ee5\u4e0b\u306e\u753b\u50cf\u306f\u3001Hibernate\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3068\u305d\u306e\u52d5\u4f5c\u65b9\u6cd5\u3092\u793a\u3057\u3066\u304a\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30af\u30e9\u30b9\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u306e\u305f\u3081\u306eJDBC \/ JTA API\u3068\u306e\u9593\u306e\u62bd\u8c61\u5316\u30ec\u30a4\u30e4\u30fc\u3068\u3057\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002\u660e\u3089\u304b\u306bHibernate\u306f\u3001JDBC\u304a\u3088\u3073JTA API\u306e\u4e0a\u306b\u69cb\u7bc9\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u3067\u306f\u3001Hibernate\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u4e2d\u6838\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u9806\u756a\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<ul class=\"post-ul\">\n<li>SessionFactory (org.hibernate.SessionFactory): SessionFactory is an immutable thread-safe cache of compiled mappings for a single database. We can get instance of org.hibernate.Session using SessionFactory.<\/li>\n<li>Session (org.hibernate.Session): Session is a single-threaded, short-lived object representing a conversation between the application and the persistent store. It wraps JDBC java.sql.Connection and works as a factory for org.hibernate.Transaction.<\/li>\n<li>Persistent objects: Persistent objects are short-lived, single threaded objects that contains persistent state and business function. These can be ordinary JavaBeans\/POJOs. They are associated with exactly one org.hibernate.Session.<\/li>\n<li>Transient objects: Transient objects are persistent classes instances that are not currently associated with a org.hibernate.Session. They may have been instantiated by the application and not yet persisted, or they may have been instantiated by a closed org.hibernate.Session.<\/li>\n<li>Transaction (org.hibernate.Transaction): Transaction is a single-threaded, short-lived object used by the application to specify atomic units of work. It abstracts the application from the underlying JDBC or JTA transaction. A org.hibernate.Session might span multiple org.hibernate.Transaction in some cases.<\/li>\n<li>ConnectionProvider (org.hibernate.connection.ConnectionProvider): ConnectionProvider is a factory for JDBC connections. It provides abstraction between the application and underlying javax.sql.DataSource or java.sql.DriverManager. It is not exposed to application, but it can be extended by the developer.<\/li>\n<li>TransactionFactory (org.hibernate.TransactionFactory): A factory for org.hibernate.Transaction instances.<\/li>\n<\/ul>\n<h3>\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u3068Java Persistence API\uff08JPA\uff09<\/h3>\n<p>\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u306fJava Persistence API\u306e\u5b9f\u88c5\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u305f\u3081\u3001\u30e2\u30c7\u30eb\u30d3\u30fc\u30f3\u306bJPA\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u306fCRUD\u64cd\u4f5c\u306e\u305f\u3081\u306b\u8a2d\u5b9a\u3092\u884c\u3063\u3066\u304f\u308c\u307e\u3059\u3002\u3053\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u4f8b\u3092\u4f7f\u3063\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30d2\u30d9\u30eb\u30cd\u30fc\u30c8\u306e\u4f8b\u5f15\u7528<\/h2>\n<p>\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3059\u308b\u969b\u306b\u306f\u30012\u3064\u306e\u8a2d\u5b9a\u30bb\u30c3\u30c8\u3092\u63d0\u4f9b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6700\u521d\u306e\u8a2d\u5b9a\u30bb\u30c3\u30c8\u306b\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u3068\u30bb\u30c3\u30b7\u30e7\u30f3\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u306b\u4f7f\u7528\u3055\u308c\u308b\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u56fa\u6709\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u30022\u756a\u76ee\u306e\u8a2d\u5b9a\u30bb\u30c3\u30c8\u306b\u306f\u3001\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u306b\u95a2\u3059\u308b\u8a2d\u5b9a\u306b\u306f\u3001XML\u30d9\u30fc\u30b9\u307e\u305f\u306f\u30d7\u30ed\u30d1\u30c6\u30a3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u63d0\u4f9b\u3059\u308b\u969b\u306b\u306f\u3001XML\u30d9\u30fc\u30b9\u307e\u305f\u306f\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306b\u306f\u3001javax.persistence\u304b\u3089\u63d0\u4f9b\u3055\u308c\u308bJPA\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u6700\u7d42\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002Eclipse\u3084\u304a\u597d\u304d\u306aIDE\u3067Maven\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u81ea\u7531\u306b\u540d\u524d\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u3055\u307e\u3056\u307e\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u79fb\u308b\u524d\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3092\u884c\u308f\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u8a2d\u5b9a<\/h3>\n<p>\u79c1\u306e\u4f8b\u3067\u306f\u3001MySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u304a\u308a\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3057\u3066\u5fc5\u8981\u306a\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>CREATE TABLE `Employee` (\r\n  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,\r\n  `name` varchar(20) DEFAULT NULL,\r\n  `role` varchar(20) DEFAULT NULL,\r\n  `insert_time` datetime DEFAULT NULL,\r\n  PRIMARY KEY (`id`)\r\n) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;\r\n<\/code><\/pre>\n<p>MySQL\u306b\u3088\u3063\u3066Employee\u30c6\u30fc\u30d6\u30eb\u306e\u300cid\u300d\u5217\u304c\u81ea\u52d5\u7684\u306b\u751f\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u79c1\u305f\u3061\u306f\u305d\u308c\u3092\u633f\u5165\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>\u30d2\u30d9\u30eb\u30cd\u30fc\u30c8\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f9d\u5b58\u95a2\u4fc2<\/h3>\n<p>\u6700\u7d42\u7684\u306apom.xml\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\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\" xsi:schemaLocation=\"https:\/\/maven.apache.org\/POM\/4.0.0 https:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\"&gt;\r\n  &lt;modelVersion&gt;4.0.0&lt;\/modelVersion&gt;\r\n  &lt;groupId&gt;com.scdev.hibernate&lt;\/groupId&gt;\r\n  &lt;artifactId&gt;HibernateExample&lt;\/artifactId&gt;\r\n  &lt;version&gt;0.0.1-SNAPSHOT&lt;\/version&gt;\r\n  &lt;name&gt;HibernateExample&lt;\/name&gt;\r\n  \r\n  &lt;dependencies&gt;\r\n  \t&lt;dependency&gt;\r\n  \t\t&lt;groupId&gt;org.hibernate&lt;\/groupId&gt;\r\n  \t\t&lt;artifactId&gt;hibernate-core&lt;\/artifactId&gt;\r\n  \t\t&lt;version&gt;4.3.5.Final&lt;\/version&gt;\r\n  \t&lt;\/dependency&gt;\r\n  \t&lt;!-- Hibernate 4 uses Jboss logging, but older versions slf4j for logging --&gt;\r\n        &lt;dependency&gt;\r\n            &lt;groupId&gt;org.slf4j&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;slf4j-simple&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.7.5&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n        &lt;dependency&gt;\r\n        \t&lt;groupId&gt;mysql&lt;\/groupId&gt;\r\n        \t&lt;artifactId&gt;mysql-connector-java&lt;\/artifactId&gt;\r\n        \t&lt;version&gt;5.0.5&lt;\/version&gt;\r\n        &lt;\/dependency&gt;\r\n  &lt;\/dependencies&gt;\r\n  \r\n  &lt;build&gt;\r\n  \t&lt;finalName&gt;${project.artifactId}&lt;\/finalName&gt;\r\n  &lt;\/build&gt;\r\n&lt;\/project&gt;\r\n<\/code><\/pre>\n<p>hibernate-core\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u306b\u306f\u3001\u3059\u3079\u3066\u306e\u30b3\u30a2\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u30af\u30e9\u30b9\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u542b\u3081\u308b\u3053\u3068\u3067\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u3059\u3079\u3066\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u79c1\u306f\u6700\u65b0\u306eHibernate\u30d0\u30fc\u30b8\u30e7\u30f3\uff084.3.5.Final\uff09\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3001Hibernate\u306f\u307e\u3060\u9032\u5316\u4e2d\u3067\u3042\u308a\u3001\u3059\u3079\u3066\u306e\u30e1\u30b8\u30e3\u30fc\u30ea\u30ea\u30fc\u30b9\u3054\u3068\u306b\u591a\u304f\u306e\u30b3\u30a2\u30af\u30e9\u30b9\u304c\u5909\u66f4\u3055\u308c\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u305f\u304c\u3063\u3066\u3001\u4ed6\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u3001Hibernate\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u30014.x.x\u306e\u3059\u3079\u3066\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u3053\u3068\u306f\u78ba\u4fe1\u3057\u3066\u3044\u307e\u3059\u3002Hibernate 4\u3067\u306fJBoss\u30ed\u30b0\u3092\u4f7f\u7528\u3057\u307e\u3059\u304c\u3001\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u30ed\u30b0\u306e\u76ee\u7684\u3067slf4j\u3092\u4f7f\u7528\u3057\u307e\u3059\u306e\u3067\u3001\u79c1\u306fslf4j-simple\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u542b\u3081\u3066\u3044\u307e\u3059\uff08\u5fc5\u8981\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff09\u3002mysql-connector-java\u306fMySQL\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306eMySQL\u30c9\u30e9\u30a4\u30d0\u30fc\u3067\u3059\u3002\u4ed6\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u5bfe\u5fdc\u3059\u308b\u30c9\u30e9\u30a4\u30d0\u30fc\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30c9\u30e1\u30a4\u30f3\u30e2\u30c7\u30eb\u306e\u30af\u30e9\u30b9<\/h3>\n<p>\u4e0a\u306e\u753b\u50cf\u3067\u308f\u304b\u308b\u3088\u3046\u306b\u3001\u79c1\u305f\u3061\u306f2\u3064\u306e\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3001Employee\u3068Employee1\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002Employee\u306f\u30b7\u30f3\u30d7\u30eb\u306aJava Bean\u30af\u30e9\u30b9\u3067\u3042\u308a\u3001XML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3057\u3066\u305d\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u8a73\u7d30\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002Employee1\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u306bJPA\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u4ed8\u3044\u305fJava Bean\u3067\u3059\u306e\u3067\u3001\u5225\u500b\u306eXML\u30d5\u30a1\u30a4\u30eb\u3067\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u63d0\u4f9b\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.model;\r\n\r\nimport java.util.Date;\r\n\r\npublic class Employee {\r\n\r\n\tprivate int id;\r\n\tprivate String name;\r\n\tprivate String role;\r\n\tprivate Date insertTime;\r\n\t\r\n\tpublic int getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(int 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\tpublic String getRole() {\r\n\t\treturn role;\r\n\t}\r\n\tpublic void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}\r\n\tpublic Date getInsertTime() {\r\n\t\treturn insertTime;\r\n\t}\r\n\tpublic void setInsertTime(Date insertTime) {\r\n\t\tthis.insertTime = insertTime;\r\n\t}\r\n\t\r\n}\r\n<\/code><\/pre>\n<p>\u5f93\u696d\u54e1\u30af\u30e9\u30b9\u306f\u30b7\u30f3\u30d7\u30eb\u306aJava\u30d3\u30fc\u30f3\u3067\u3059\u304c\u3001\u7279\u7b46\u3059\u3079\u304d\u70b9\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.model;\r\n\r\nimport java.util.Date;\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\nimport javax.persistence.UniqueConstraint;\r\n\r\n@Entity\r\n@Table(name=\"Employee\", \r\n\t   uniqueConstraints={@UniqueConstraint(columnNames={\"ID\"})})\r\npublic class Employee1 {\r\n\r\n\t@Id\r\n\t@GeneratedValue(strategy=GenerationType.IDENTITY)\r\n\t@Column(name=\"ID\", nullable=false, unique=true, length=11)\r\n\tprivate int id;\r\n\t\r\n\t@Column(name=\"NAME\", length=20, nullable=true)\r\n\tprivate String name;\r\n\t\r\n\t@Column(name=\"ROLE\", length=20, nullable=true)\r\n\tprivate String role;\r\n\t\r\n\t@Column(name=\"insert_time\", nullable=true)\r\n\tprivate Date insertTime;\r\n\t\r\n\tpublic int getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic void setId(int 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\tpublic String getRole() {\r\n\t\treturn role;\r\n\t}\r\n\tpublic void setRole(String role) {\r\n\t\tthis.role = role;\r\n\t}\r\n\tpublic Date getInsertTime() {\r\n\t\treturn insertTime;\r\n\t}\r\n\tpublic void setInsertTime(Date insertTime) {\r\n\t\tthis.insertTime = insertTime;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<p>javax.persistence.Entity\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001Hibernate\u304c\u63d0\u4f9b\u3059\u308bJPA\u5b9f\u88c5\u306b\u3088\u3063\u3066\u6c38\u7d9a\u5316\u3055\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u30d3\u30fc\u30f3\u3068\u3057\u3066\u30af\u30e9\u30b9\u3092\u30de\u30fc\u30af\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002javax.persistence.Table\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u3068\u5217\u306e\u4e00\u610f\u5236\u7d04\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002javax.persistence.Id\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u4e3b\u30ad\u30fc\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002javax.persistence.GeneratedValue\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u81ea\u52d5\u751f\u6210\u3055\u308c\u308b\u3053\u3068\u3092\u5b9a\u7fa9\u3057\u3001GenerationType.IDENTITY\u6226\u7565\u304c\u4f7f\u7528\u3055\u308c\u308b\u305f\u3081\u3001\u751f\u6210\u3055\u308c\u305f\u300cid\u300d\u306e\u5024\u304c\u30d3\u30fc\u30f3\u306b\u30de\u30c3\u30d7\u3055\u308c\u3001Java\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002javax.persistence.Column\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u30c6\u30fc\u30d6\u30eb\u5217\u306b\u30de\u30c3\u30d7\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u3001\u30d3\u30fc\u30f3\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u5bfe\u3057\u3066\u9577\u3055\u3001nullable\u3001\u304a\u3088\u3073\u4e00\u610f\u6027\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30d2\u30d0\u30cd\u30a4\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0XML\u306e\u8a2d\u5b9a<\/h3>\n<p>\u4e0a\u8a18\u306e\u901a\u308a\u3001\u793e\u54e1\u30af\u30e9\u30b9\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306b\u306fXML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u4efb\u610f\u306e\u540d\u524d\u3092\u9078\u3076\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30c6\u30fc\u30d6\u30eb\u307e\u305f\u306fJava Bean\u306e\u540d\u524d\u3092\u9078\u3076\u3053\u3068\u304c\u660e\u78ba\u3067\u826f\u3044\u3067\u3059\u3002Employee Bean\u306eHibernate\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002employee.hbm.xml<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\"?&gt;\r\n&lt;!DOCTYPE hibernate-mapping PUBLIC \"-\/\/Hibernate\/Hibernate Mapping DTD 3.0\/\/EN\"\r\n\"https:\/\/hibernate.org\/dtd\/hibernate-mapping-3.0.dtd\"&gt;\r\n\r\n&lt;hibernate-mapping&gt;\r\n\t&lt;class name=\"com.scdev.hibernate.model.Employee\" table=\"EMPLOYEE\"&gt;\r\n        &lt;id name=\"id\" type=\"int\"&gt;\r\n            &lt;column name=\"ID\" \/&gt;\r\n            &lt;generator class=\"increment\" \/&gt;\r\n        &lt;\/id&gt;\r\n        &lt;property name=\"name\" type=\"java.lang.String\"&gt;\r\n            &lt;column name=\"NAME\" \/&gt;\r\n        &lt;\/property&gt;\r\n        &lt;property name=\"role\" type=\"java.lang.String\"&gt;\r\n            &lt;column name=\"ROLE\" \/&gt;\r\n        &lt;\/property&gt;\r\n        &lt;property name=\"insertTime\" type=\"timestamp\"&gt;\r\n        \t&lt;column name=\"insert_time\" \/&gt;\r\n        &lt;\/property&gt;\r\n    &lt;\/class&gt;\r\n&lt;\/hibernate-mapping&gt;\r\n<\/code><\/pre>\n<p>XML\u306e\u8a2d\u5b9a\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3068\u540c\u3058\u3053\u3068\u3092\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30d2\u30d0\u30cd\u30a4\u30c8\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u3001xml\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u306e\u305f\u3081\u306e1\u3064\u306ehibernate\u8a2d\u5b9axml\u30d5\u30a1\u30a4\u30eb\u3068\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u306e\u305f\u3081\u306e\u3082\u30461\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002hibernate.cfg.xml<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;!DOCTYPE hibernate-configuration PUBLIC\r\n\t\t\"-\/\/Hibernate\/Hibernate Configuration DTD 3.0\/\/EN\"\r\n\t\t\"https:\/\/hibernate.org\/dtd\/hibernate-configuration-3.0.dtd\"&gt;\r\n&lt;hibernate-configuration&gt;\r\n\t&lt;session-factory&gt;\r\n\t\t&lt;!-- Database connection properties - Driver, URL, user, password --&gt;\r\n\t\t&lt;property name=\"hibernate.connection.driver_class\"&gt;com.mysql.jdbc.Driver&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.url\"&gt;jdbc:mysql:\/\/localhost\/TestDB&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.username\"&gt;scdev&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.password\"&gt;scdev123&lt;\/property&gt;\r\n\t\t&lt;!-- Connection Pool Size --&gt;\r\n\t\t&lt;property name=\"hibernate.connection.pool_size\"&gt;1&lt;\/property&gt;\r\n\t\t\r\n\t\t&lt;!-- org.hibernate.HibernateException: No CurrentSessionContext configured! --&gt;\r\n\t\t&lt;property name=\"hibernate.current_session_context_class\"&gt;thread&lt;\/property&gt;\r\n\t\t\r\n\t\t&lt;!-- Outputs the SQL queries, should be disabled in Production --&gt;\r\n\t\t&lt;property name=\"hibernate.show_sql\"&gt;true&lt;\/property&gt;\r\n\t\t\r\n\t\t&lt;!-- Dialect is required to let Hibernate know the Database Type, MySQL, Oracle etc\r\n\t\t\tHibernate 4 automatically figure out Dialect from Database Connection Metadata --&gt;\r\n\t\t&lt;property name=\"hibernate.dialect\"&gt;org.hibernate.dialect.MySQLDialect&lt;\/property&gt; \r\n\r\n\t\t&lt;!-- mapping file, we can use Bean annotations too --&gt; \r\n\t\t&lt;mapping resource=\"employee.hbm.xml\" \/&gt;\r\n\t&lt;\/session-factory&gt;\r\n&lt;\/hibernate-configuration&gt;\r\n<\/code><\/pre>\n<p>\u307b\u3068\u3093\u3069\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u306b\u95a2\u4fc2\u3057\u3066\u304a\u308a\u3001\u305d\u306e\u4ed6\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8a73\u7d30\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001Hibernate\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u8a2d\u5b9a\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8907\u6570\u306eHibernate\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u3092\u5b9a\u7fa9\u3057\u3066\u3053\u3053\u3067\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u30de\u30c3\u30d4\u30f3\u30b0\u306f\u30bb\u30c3\u30b7\u30e7\u30f3\u30d5\u30a1\u30af\u30c8\u30ea\u30fc\u306b\u56fa\u6709\u306e\u3082\u306e\u3067\u3059\u3002hibernate-annotation.cfg.xml<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;!DOCTYPE hibernate-configuration PUBLIC\r\n\t\t\"-\/\/Hibernate\/Hibernate Configuration DTD 3.0\/\/EN\"\r\n\t\t\"https:\/\/hibernate.org\/dtd\/hibernate-configuration-3.0.dtd\"&gt;\r\n&lt;hibernate-configuration&gt;\r\n\t&lt;session-factory&gt;\r\n\t\t&lt;!-- Database connection properties - Driver, URL, user, password --&gt;\r\n\t\t&lt;property name=\"hibernate.connection.driver_class\"&gt;com.mysql.jdbc.Driver&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.url\"&gt;jdbc:mysql:\/\/localhost\/TestDB&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.username\"&gt;scdev&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.connection.password\"&gt;scdev123&lt;\/property&gt;\r\n\t\t\r\n\t\t&lt;!-- org.hibernate.HibernateException: No CurrentSessionContext configured! --&gt;\r\n\t\t&lt;property name=\"hibernate.current_session_context_class\"&gt;thread&lt;\/property&gt;\r\n\t\t\r\n\t\t&lt;!-- Mapping with model class containing annotations --&gt;\r\n\t\t&lt;mapping class=\"com.scdev.hibernate.model.Employee1\"\/&gt;\r\n\t&lt;\/session-factory&gt;\r\n&lt;\/hibernate-configuration&gt;\r\n<\/code><\/pre>\n<p>\u307b\u3068\u3093\u3069\u306e\u8a2d\u5b9a\u306fXML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3068\u540c\u69d8\u3067\u3059\u304c\u3001\u552f\u4e00\u306e\u9055\u3044\u306f\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u8a2d\u5b9a\u3067\u3059\u3002\u30af\u30e9\u30b9\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4e21\u65b9\u306b\u5bfe\u3057\u3066\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u8a2d\u5b9a\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u66f8\u304d\u63db\u3048\u308b\uff08\uff11\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\uff09\uff1a<br \/>\n\u30d2\u30d0\u30cd\u30a4\u30c8\u306eSessionFactory<\/h3>\n<p>\u79c1\u306f\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002XML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3068\u30d7\u30ed\u30d1\u30c6\u30a3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u304b\u3089SessionFactory\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u30d7\u30ed\u30d1\u30c6\u30a3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3067\u306f\u3001\u30d7\u30ed\u30d1\u30c6\u30a3\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092\u30af\u30e9\u30b9\u3067\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u304c\u3001\u30b7\u30f3\u30d7\u30eb\u3055\u306e\u305f\u3081\u306b\u3001\u30af\u30e9\u30b9\u81ea\u4f53\u3067Properties\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.util;\r\n\r\nimport java.util.Properties;\r\n\r\nimport org.hibernate.SessionFactory;\r\nimport org.hibernate.boot.registry.StandardServiceRegistryBuilder;\r\nimport org.hibernate.cfg.Configuration;\r\nimport org.hibernate.service.ServiceRegistry;\r\n\r\nimport com.scdev.hibernate.model.Employee1;\r\n\r\npublic class HibernateUtil {\r\n\r\n\t\/\/XML based configuration\r\n\tprivate static SessionFactory sessionFactory;\r\n\t\r\n\t\/\/Annotation based configuration\r\n\tprivate static SessionFactory sessionAnnotationFactory;\r\n\t\r\n\t\/\/Property based configuration\r\n\tprivate static SessionFactory sessionJavaConfigFactory;\r\n\r\n    private static SessionFactory buildSessionFactory() {\r\n        try {\r\n            \/\/ Create the SessionFactory from hibernate.cfg.xml\r\n        \tConfiguration configuration = new Configuration();\r\n        \tconfiguration.configure(\"hibernate.cfg.xml\");\r\n        \tSystem.out.println(\"Hibernate Configuration loaded\");\r\n        \t\r\n        \tServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();\r\n        \tSystem.out.println(\"Hibernate serviceRegistry created\");\r\n        \t\r\n        \tSessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);\r\n        \t\r\n            return sessionFactory;\r\n        }\r\n        catch (Throwable ex) {\r\n            \/\/ Make sure you log the exception, as it might be swallowed\r\n            System.err.println(\"Initial SessionFactory creation failed.\" + ex);\r\n            throw new ExceptionInInitializerError(ex);\r\n        }\r\n    }\r\n\r\n    private static SessionFactory buildSessionAnnotationFactory() {\r\n    \ttry {\r\n            \/\/ Create the SessionFactory from hibernate.cfg.xml\r\n        \tConfiguration configuration = new Configuration();\r\n        \tconfiguration.configure(\"hibernate-annotation.cfg.xml\");\r\n        \tSystem.out.println(\"Hibernate Annotation Configuration loaded\");\r\n        \t\r\n        \tServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();\r\n        \tSystem.out.println(\"Hibernate Annotation serviceRegistry created\");\r\n        \t\r\n        \tSessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);\r\n        \t\r\n            return sessionFactory;\r\n        }\r\n        catch (Throwable ex) {\r\n            \/\/ Make sure you log the exception, as it might be swallowed\r\n            System.err.println(\"Initial SessionFactory creation failed.\" + ex);\r\n            throw new ExceptionInInitializerError(ex);\r\n        }\r\n\t}\r\n\r\n    private static SessionFactory buildSessionJavaConfigFactory() {\r\n    \ttry {\r\n    \tConfiguration configuration = new Configuration();\r\n\t\t\r\n\t\t\/\/Create Properties, can be read from property files too\r\n\t\tProperties props = new Properties();\r\n\t\tprops.put(\"hibernate.connection.driver_class\", \"com.mysql.jdbc.Driver\");\r\n\t\tprops.put(\"hibernate.connection.url\", \"jdbc:mysql:\/\/localhost\/TestDB\");\r\n\t\tprops.put(\"hibernate.connection.username\", \"scdev\");\r\n\t\tprops.put(\"hibernate.connection.password\", \"scdev123\");\r\n\t\tprops.put(\"hibernate.current_session_context_class\", \"thread\");\r\n\t\t\r\n\t\tconfiguration.setProperties(props);\r\n\t\t\r\n\t\t\/\/we can set mapping file or class with annotation\r\n\t\t\/\/addClass(Employee1.class) will look for resource\r\n\t\t\/\/ com\/scdev\/hibernate\/model\/Employee1.hbm.xml (not good)\r\n\t\tconfiguration.addAnnotatedClass(Employee1.class);\r\n\t\t\r\n\t\tServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();\r\n    \tSystem.out.println(\"Hibernate Java Config serviceRegistry created\");\r\n    \t\r\n    \tSessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);\r\n    \t\r\n        return sessionFactory;\r\n    \t}\r\n        catch (Throwable ex) {\r\n            System.err.println(\"Initial SessionFactory creation failed.\" + ex);\r\n            throw new ExceptionInInitializerError(ex);\r\n        }\r\n\t}\r\n    \r\n\tpublic static SessionFactory getSessionFactory() {\r\n\t\tif(sessionFactory == null) sessionFactory = buildSessionFactory();\r\n        return sessionFactory;\r\n    }\r\n\t\r\n\tpublic static SessionFactory getSessionAnnotationFactory() {\r\n\t\tif(sessionAnnotationFactory == null) sessionAnnotationFactory = buildSessionAnnotationFactory();\r\n        return sessionAnnotationFactory;\r\n    }\r\n\t\r\n\tpublic static SessionFactory getSessionJavaConfigFactory() {\r\n\t\tif(sessionJavaConfigFactory == null) sessionJavaConfigFactory = buildSessionJavaConfigFactory();\r\n        return sessionJavaConfigFactory;\r\n    }\r\n\t\r\n}\r\n<\/code><\/pre>\n<p>XML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u306e\u5834\u5408\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306b\u95a2\u308f\u3089\u305a\u3001SessionFactory\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u306f\u540c\u3058\u3067\u3059\u3002\u30d7\u30ed\u30d1\u30c6\u30a3\u30d9\u30fc\u30b9\u306e\u5834\u5408\u306f\u3001Configuration\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\u3057\u3001SessionFactory\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002SessionFactory\u306e\u4f5c\u6210\u5168\u4f53\u306e\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u8a2d\u5b9a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>ServiceRegistry\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u8a2d\u5b9a\u3092\u9069\u7528\u3059\u308b\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>configuration.buildSessionFactory() \u3092\u4f7f\u7528\u3057\u3001ServiceRegistry\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5f15\u6570\u3068\u3057\u3066SessionFactory\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3059\u308b\u3002<\/ol>\n<p>\u79c1\u305f\u3061\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3082\u3046\u307b\u307c\u5b8c\u6210\u3057\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u3066\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u306eXML\u8a2d\u5b9a\u306e\u30c6\u30b9\u30c8<\/h3>\n<p>\u79c1\u305f\u3061\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.main;\r\n\r\nimport java.util.Date;\r\n\r\nimport org.hibernate.Session;\r\n\r\nimport com.scdev.hibernate.model.Employee;\r\nimport com.scdev.hibernate.util.HibernateUtil;\r\n\r\npublic class HibernateMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tEmployee emp = new Employee();\r\n\t\temp.setName(\"Pankaj\");\r\n\t\temp.setRole(\"CEO\");\r\n\t\temp.setInsertTime(new Date());\r\n\t\t\r\n\t\t\/\/Get Session\r\n\t\tSession session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n\t\t\/\/start transaction\r\n\t\tsession.beginTransaction();\r\n\t\t\/\/Save the Model object\r\n\t\tsession.save(emp);\r\n\t\t\/\/Commit transaction\r\n\t\tsession.getTransaction().commit();\r\n\t\tSystem.out.println(\"Employee ID=\"+emp.getId());\r\n\t\t\r\n\t\t\/\/terminate session factory, otherwise program won't end\r\n\t\tHibernateUtil.getSessionFactory().close();\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u81ea\u5df1\u7406\u89e3\u3092\u6301\u3063\u3066\u304a\u308a\u3001\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>May 06, 2014 12:40:06 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;\r\nINFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}\r\nMay 06, 2014 12:40:06 AM org.hibernate.Version logVersion\r\nINFO: HHH000412: Hibernate Core {4.3.5.Final}\r\nMay 06, 2014 12:40:06 AM org.hibernate.cfg.Environment &lt;clinit&gt;\r\nINFO: HHH000206: hibernate.properties not found\r\nMay 06, 2014 12:40:06 AM org.hibernate.cfg.Environment buildBytecodeProvider\r\nINFO: HHH000021: Bytecode provider name : javassist\r\nMay 06, 2014 12:40:06 AM org.hibernate.cfg.Configuration configure\r\nINFO: HHH000043: Configuring from resource: hibernate.cfg.xml\r\nMay 06, 2014 12:40:06 AM org.hibernate.cfg.Configuration getConfigurationInputStream\r\nINFO: HHH000040: Configuration resource: hibernate.cfg.xml\r\nMay 06, 2014 12:40:07 AM org.hibernate.cfg.Configuration addResource\r\nINFO: HHH000221: Reading mappings from resource: employee.hbm.xml\r\nMay 06, 2014 12:40:08 AM org.hibernate.cfg.Configuration doConfigure\r\nINFO: HHH000041: Configured SessionFactory: null\r\nHibernate Configuration loaded\r\nHibernate serviceRegistry created\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:\/\/localhost\/TestDB]\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000046: Connection properties: {user=scdev, password=****}\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000006: Autocommit mode: false\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nINFO: HHH000115: Hibernate connection pool size: 1 (min=1)\r\nMay 06, 2014 12:40:08 AM org.hibernate.dialect.Dialect &lt;init&gt;\r\nINFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation\r\nINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService\r\nINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)\r\nMay 06, 2014 12:40:08 AM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &lt;init&gt;\r\nINFO: HHH000397: Using ASTQueryTranslatorFactory\r\nHibernate: select max(ID) from EMPLOYEE\r\nHibernate: insert into EMPLOYEE (NAME, ROLE, insert_time, ID) values (?, ?, ?, ?)\r\nEmployee ID=19\r\nMay 06, 2014 12:40:08 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop\r\nINFO: HHH000030: Cleaning up connection pool [jdbc:mysql:\/\/localhost\/TestDB]\r\n<\/code><\/pre>\n<p>\u751f\u6210\u3055\u308c\u305f\u5f93\u696d\u54e1ID\u304c\u5370\u5237\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u78ba\u8a8d\u3057\u3066\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u3057\u307e\u3059\uff1aHibernate\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u5b9a\u30c6\u30b9\u30c8<\/h3>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.main;\r\n\r\nimport java.util.Date;\r\n\r\nimport org.hibernate.Session;\r\nimport org.hibernate.SessionFactory;\r\n\r\nimport com.scdev.hibernate.model.Employee1;\r\nimport com.scdev.hibernate.util.HibernateUtil;\r\n\r\npublic class HibernateAnnotationMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tEmployee1 emp = new Employee1();\r\n\t\temp.setName(\"David\");\r\n\t\temp.setRole(\"Developer\");\r\n\t\temp.setInsertTime(new Date());\r\n\t\t\r\n\t\t\/\/Get Session\r\n\t\tSessionFactory sessionFactory = HibernateUtil.getSessionAnnotationFactory();\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\t\/\/start transaction\r\n\t\tsession.beginTransaction();\r\n\t\t\/\/Save the Model object\r\n\t\tsession.save(emp);\r\n\t\t\/\/Commit transaction\r\n\t\tsession.getTransaction().commit();\r\n\t\tSystem.out.println(\"Employee ID=\"+emp.getId());\r\n\t\t\r\n\t\t\/\/terminate session factory, otherwise program won't end\r\n\t\tsessionFactory.close();\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>May 06, 2014 12:42:22 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;\r\nINFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}\r\nMay 06, 2014 12:42:22 AM org.hibernate.Version logVersion\r\nINFO: HHH000412: Hibernate Core {4.3.5.Final}\r\nMay 06, 2014 12:42:22 AM org.hibernate.cfg.Environment &lt;clinit&gt;\r\nINFO: HHH000206: hibernate.properties not found\r\nMay 06, 2014 12:42:22 AM org.hibernate.cfg.Environment buildBytecodeProvider\r\nINFO: HHH000021: Bytecode provider name : javassist\r\nMay 06, 2014 12:42:22 AM org.hibernate.cfg.Configuration configure\r\nINFO: HHH000043: Configuring from resource: hibernate-annotation.cfg.xml\r\nMay 06, 2014 12:42:22 AM org.hibernate.cfg.Configuration getConfigurationInputStream\r\nINFO: HHH000040: Configuration resource: hibernate-annotation.cfg.xml\r\nMay 06, 2014 12:42:23 AM org.hibernate.cfg.Configuration doConfigure\r\nINFO: HHH000041: Configured SessionFactory: null\r\nHibernate Annotation Configuration loaded\r\nHibernate Annotation serviceRegistry created\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:\/\/localhost\/TestDB]\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000046: Connection properties: {user=scdev, password=****}\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000006: Autocommit mode: false\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nINFO: HHH000115: Hibernate connection pool size: 20 (min=1)\r\nMay 06, 2014 12:42:23 AM org.hibernate.dialect.Dialect &lt;init&gt;\r\nINFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation\r\nINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService\r\nINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)\r\nMay 06, 2014 12:42:23 AM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &lt;init&gt;\r\nINFO: HHH000397: Using ASTQueryTranslatorFactory\r\nEmployee ID=20\r\nMay 06, 2014 12:42:23 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop\r\nINFO: HHH000030: Cleaning up connection pool [jdbc:mysql:\/\/localhost\/TestDB]\r\n<\/code><\/pre>\n<p>\u51fa\u529b\u3092\u898b\u3066\u3001XML\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u306e\u51fa\u529b\u3068\u6bd4\u8f03\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u305d\u3053\u306b\u306f\u3044\u304f\u3064\u304b\u306e\u9055\u3044\u304c\u5206\u304b\u308b\u3067\u3057\u3087\u3046\u3002\u4f8b\u3048\u3070\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3067\u306f\u63a5\u7d9a\u30d7\u30fc\u30eb\u30b5\u30a4\u30ba\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3067\u3042\u308b20\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h3>\u30d2\u30d0\u30cd\u30fc\u30c8\u306eJava\u8a2d\u5b9a\u306e\u30c6\u30b9\u30c8<\/h3>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.main;\r\n\r\nimport java.util.Date;\r\n\r\nimport org.hibernate.Session;\r\nimport org.hibernate.SessionFactory;\r\n\r\nimport com.scdev.hibernate.model.Employee1;\r\nimport com.scdev.hibernate.util.HibernateUtil;\r\n\r\npublic class HibernateJavaConfigMain {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tEmployee1 emp = new Employee1();\r\n\t\temp.setName(\"Lisa\");\r\n\t\temp.setRole(\"Manager\");\r\n\t\temp.setInsertTime(new Date());\r\n\t\t\r\n\t\t\/\/Get Session\r\n\t\tSessionFactory sessionFactory = HibernateUtil.getSessionJavaConfigFactory();\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\t\/\/start transaction\r\n\t\tsession.beginTransaction();\r\n\t\t\/\/Save the Model object\r\n\t\tsession.save(emp);\r\n\t\t\/\/Commit transaction\r\n\t\tsession.getTransaction().commit();\r\n\t\tSystem.out.println(\"Employee ID=\"+emp.getId());\r\n\t\t\r\n\t\t\/\/terminate session factory, otherwise program won't end\r\n\t\tsessionFactory.close();\r\n\t}\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u51fa\u529b\u7d50\u679c\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>May 06, 2014 12:45:09 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;\r\nINFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}\r\nMay 06, 2014 12:45:09 AM org.hibernate.Version logVersion\r\nINFO: HHH000412: Hibernate Core {4.3.5.Final}\r\nMay 06, 2014 12:45:09 AM org.hibernate.cfg.Environment &lt;clinit&gt;\r\nINFO: HHH000206: hibernate.properties not found\r\nMay 06, 2014 12:45:09 AM org.hibernate.cfg.Environment buildBytecodeProvider\r\nINFO: HHH000021: Bytecode provider name : javassist\r\nHibernate Java Config serviceRegistry created\r\nMay 06, 2014 12:45:09 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nWARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)\r\nMay 06, 2014 12:45:09 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:\/\/localhost\/TestDB]\r\nMay 06, 2014 12:45:09 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000046: Connection properties: {user=scdev, password=****}\r\nMay 06, 2014 12:45:09 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator\r\nINFO: HHH000006: Autocommit mode: false\r\nMay 06, 2014 12:45:09 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure\r\nINFO: HHH000115: Hibernate connection pool size: 20 (min=1)\r\nMay 06, 2014 12:45:10 AM org.hibernate.dialect.Dialect &lt;init&gt;\r\nINFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect\r\nMay 06, 2014 12:45:10 AM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation\r\nINFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4\r\nMay 06, 2014 12:45:10 AM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService\r\nINFO: HHH000399: Using default transaction strategy (direct JDBC transactions)\r\nMay 06, 2014 12:45:10 AM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &lt;init&gt;\r\nINFO: HHH000397: Using ASTQueryTranslatorFactory\r\nEmployee ID=21\r\nMay 06, 2014 12:45:10 AM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl stop\r\nINFO: HHH000030: Cleaning up connection pool [jdbc:mysql:\/\/localhost\/TestDB]\r\n<\/code><\/pre>\n<p>\u521d\u5fc3\u8005\u5411\u3051\u306e\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u4ee5\u4e0a\u3067\u3059\u3002\u3053\u308c\u304c\u5341\u5206\u306a\u30b9\u30bf\u30fc\u30c8\u306b\u306a\u308b\u3053\u3068\u3092\u9858\u3063\u3066\u3044\u307e\u3059\u3002\u4eca\u5f8c\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u3055\u307e\u3056\u307e\u306a\u6a5f\u80fd\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u5b8c\u5168\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001\u3055\u3089\u306b\u5b66\u3076\u305f\u3081\u306b\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Hibernate\u521d\u5fc3\u8005\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>\u521d\u5fc3\u8005\u306e\u305f\u3081\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3088\u3046\u3053\u305d\u3002Hibernate\u306f\u3001\u6700\u3082\u5e83\u304f\u4f7f\u7528\u3055\u308c\u3066\u3044\u308bJava\u306eORM\u30c4\u30fc\u30eb\u306e\u4e00\u3064\u3067\u3059\u3002\u307b\u3068\u3093\u3069\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30ca\u30eb\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-711","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>\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/\u521d\u5fc3\u8005\u5411\u3051\u306ehibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\" \/>\n<meta property=\"og:description\" content=\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/\u521d\u5fc3\u8005\u5411\u3051\u306ehibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-06T07:37:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T16:51:23+00:00\" \/>\n<meta name=\"author\" content=\"\u512a\u6597, \u671d\u967d\" \/>\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=\"\u512a\u6597, \u671d\u967d\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"67\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\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\",\"name\":\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-12-06T07:37:35+00:00\",\"dateModified\":\"2025-07-31T16:51:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\"},\"description\":\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\"}]},{\"@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\/cab7534c71201607a41f395de14d7d28\",\"name\":\"\u512a\u6597, \u671d\u967d\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"caption\":\"\u512a\u6597, \u671d\u967d\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","description":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/\u521d\u5fc3\u8005\u5411\u3051\u306ehibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_locale":"ja_JP","og_type":"article","og_title":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb","og_description":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/\u521d\u5fc3\u8005\u5411\u3051\u306ehibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-06T07:37:35+00:00","article_modified_time":"2025-07-31T16:51:23+00:00","author":"\u512a\u6597, \u671d\u967d","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u512a\u6597, \u671d\u967d","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"67\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/","name":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-12-06T07:37:35+00:00","dateModified":"2025-07-31T16:51:23+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28"},"description":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\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\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"\u521d\u5fc3\u8005\u5411\u3051\u306eHibernate\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb"}]},{"@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\/cab7534c71201607a41f395de14d7d28","name":"\u512a\u6597, \u671d\u967d","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","caption":"\u512a\u6597, \u671d\u967d"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e5%88%9d%e5%bf%83%e8%80%85%e5%90%91%e3%81%91%e3%81%aehibernate%e3%83%81%e3%83%a5%e3%83%bc%e3%83%88%e3%83%aa%e3%82%a2%e3%83%ab\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/711","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":44055,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/711\/revisions\/44055"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}