{"id":948,"date":"2022-07-09T21:07:37","date_gmt":"2023-08-17T10:55:03","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/"},"modified":"2025-08-01T03:45:55","modified_gmt":"2025-07-31T18:45:55","slug":"%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/","title":{"rendered":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b &#8211; @NamedQuery"},"content":{"rendered":"<p>\u3088\u3046\u3053\u305d\u3001Hibernate Named Query\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3002HQL\u3068Native SQL Query\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u3002\u3082\u3057\u591a\u304f\u306e\u30af\u30a8\u30ea\u304c\u3042\u308b\u5834\u5408\u3001\u305d\u308c\u3089\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u306b\u6563\u3089\u3070\u3063\u3066\u3057\u307e\u3044\u3001\u30b3\u30fc\u30c9\u306e\u6563\u4e71\u3092\u5f15\u304d\u8d77\u3053\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3053\u3067Hibernate\u3067\u306f\u3001\u30af\u30a8\u30ea\u3092\u4e2d\u592e\u306e\u5834\u6240\u3067\u5b9a\u7fa9\u3057\u3001\u30b3\u30fc\u30c9\u306e\u3069\u3053\u3067\u3082\u4f7f\u7528\u3067\u304d\u308bNamed Query\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002HQL\u3068Native SQL\u306e\u4e21\u65b9\u306b\u5bfe\u3057\u3066Named Query\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30cd\u30a4\u30c6\u30a3\u30d6\u306e\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u8a00\u3044\u63db\u3048\u308b\uff081\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u307f\u5fc5\u8981\uff09\uff1a<br \/>\n\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea<\/h2>\n<p>\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306f\u3001\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u3067\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3057\u3001JPA\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e@NamedQuery\u3068@NamedNativeQuery\u3092\u4f7f\u7528\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u4eca\u65e5\u306f\u3001\u305d\u308c\u3089\u306e\u4e21\u65b9\u3068\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3092\u4f7f\u7528\u3059\u308b\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002HQL\u306e\u4f8b\u3068\u540c\u3058\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3057\u307e\u3059\u306e\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7SQL\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u305d\u306e\u6295\u7a3f\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u79c1\u305f\u3061\u306e\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306e\u4f8b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306b\u306f\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u3068\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3Bean\u30af\u30e9\u30b9\u306e\u4e21\u65b9\u3067\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u6700\u7d42\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u9020\u306f\u3001\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u4e3b\u306b\u30cf\u30a4\u30d0\u30cd\u30a4\u30c8\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306b\u95a2\u9023\u3059\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u7126\u70b9\u3092\u5f53\u3066\u307e\u3059\u3002<\/p>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306e\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4e00\u3064\u3060\u3051\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u300cHibernate\u306e\u8a2d\u5b9aXML\u300d<\/h3>\n<p>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u306e\u6587\u3092\u8a00\u3044\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u4e00\u3064\u3067\u3059\uff1a<br \/>\n\u300chibernate.cfg.xml\u300d<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n  &lt;!DOCTYPE hibernate-configuration SYSTEM \"https:\/\/hibernate.sourceforge.net\/hibernate-configuration-3.0.dtd\"&gt;\r\n&lt;hibernate-configuration&gt;\r\n\t&lt;session-factory&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.password\"&gt;scdev123&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.dialect\"&gt;org.hibernate.dialect.MySQLDialect&lt;\/property&gt;\r\n\r\n\t\t&lt;property name=\"hibernate.current_session_context_class\"&gt;thread&lt;\/property&gt;\r\n\t\t&lt;property name=\"hibernate.show_sql\"&gt;true&lt;\/property&gt;\r\n\r\n\t\t&lt;mapping class=\"com.scdev.hibernate.model.Employee\" \/&gt;\r\n\t\t&lt;mapping class=\"com.scdev.hibernate.model.Address\" \/&gt;\r\n\t\t&lt;mapping resource=\"named-queries.hbm.xml\" \/&gt;\r\n\t&lt;\/session-factory&gt;\r\n&lt;\/hibernate-configuration&gt;\r\n<\/code><\/pre>\n<h3>Hibernate\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30eaXML<\/h3>\n<p>\u79c1\u305f\u3061\u306f\u3001HQL\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3068\u30cd\u30a4\u30c6\u30a3\u30d6SQL\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3060\u3051\u3092\u542b\u3080\u3001\u30d2\u30d9\u30eb\u30cd\u30a4\u30c8\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb\u300cnamed-queries.hbm.xml\u300d\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<\/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\t\"https:\/\/hibernate.org\/dtd\/hibernate-mapping-3.0.dtd\"&gt;\r\n\t\r\n&lt;hibernate-mapping&gt;\r\n\t&lt;query name=\"HQL_GET_ALL_EMPLOYEE\"&gt;from Employee&lt;\/query&gt;\r\n\r\n\t&lt;query name=\"HQL_GET_EMPLOYEE_BY_ID\"&gt;\r\n\t\t&lt;![CDATA[from Employee where emp_id = :id]]&gt;\r\n\t&lt;\/query&gt;\r\n\r\n\t&lt;query name=\"HQL_GET_EMPLOYEE_BY_SALARY\"&gt;\r\n\t\t&lt;![CDATA[from Employee where emp_salary &gt; :salary]]&gt;\r\n\t&lt;\/query&gt;\r\n\t\r\n\t&lt;sql-query name=\"SQL_GET_ALL_EMPLOYEE\"&gt;\r\n\t\t&lt;![CDATA[select emp_id, emp_name, emp_salary from Employee]]&gt;\r\n\t&lt;\/sql-query&gt;\r\n\t\r\n\t&lt;sql-query name=\"SQL_GET_ALL_EMP_ADDRESS\"&gt;\r\n\t\t&lt;![CDATA[select {e.*}, {a.*} from Employee e join Address a ON e.emp_id=a.emp_id]]&gt;\r\n\t\t&lt;return alias=\"e\" class=\"com.scdev.hibernate.model.Employee\" \/&gt;\r\n\t\t&lt;return-join alias=\"a\" property=\"e.address\"&gt;&lt;\/return-join&gt;\r\n\t&lt;\/sql-query&gt;\r\n&lt;\/hibernate-mapping&gt;\r\n<\/code><\/pre>\n<p>HQL\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306b\u306fquery\u8981\u7d20\u3092\u3001\u30cd\u30a4\u30c6\u30a3\u30d6SQL\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306b\u306fsql-query\u8981\u7d20\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u7d50\u679c\u30bb\u30c3\u30c8\u304c\u30de\u30c3\u30d4\u30f3\u30b0\u3055\u308c\u308b\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\u3092\u5ba3\u8a00\u3059\u308b\u305f\u3081\u306b\u3001return\u8981\u7d20\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8907\u6570\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u304c\u3042\u308b\u5834\u5408\u306b\u306f\u3001return-join\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u30de\u30c3\u30d4\u30f3\u30b0\u306eXML\u30d5\u30a1\u30a4\u30eb\u304c\u58ca\u308c\u306a\u3044\u3088\u3046\u306b\u3001Hibernate\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3092\u5ba3\u8a00\u3059\u308b\u969b\u306b\u306fCDATA\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u3046\u3057\u306a\u3044\u3068\u3001&lt;\u3068&gt;\u306e\u8a18\u53f7\u304c\u30de\u30c3\u30d4\u30f3\u30b0\u3092\u4e71\u3059\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306e\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u30d2\u30d9\u30eb\u30cd\u30a4\u30c8\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea@NamedQuery\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u306a\u308a\u307e\u3059\u3002<\/h3>\n<p>\u79c1\u305f\u3061\u306f2\u3064\u306e\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3001&#8221;Employee&#8221;\u3068&#8221;Address&#8221;\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002Address\u30af\u30e9\u30b9\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.model;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.Id;\r\nimport javax.persistence.NamedNativeQueries;\r\nimport javax.persistence.NamedNativeQuery;\r\nimport javax.persistence.NamedQueries;\r\nimport javax.persistence.NamedQuery;\r\nimport javax.persistence.OneToOne;\r\nimport javax.persistence.PrimaryKeyJoinColumn;\r\nimport javax.persistence.Table;\r\n\r\nimport org.hibernate.annotations.GenericGenerator;\r\nimport org.hibernate.annotations.Parameter;\r\n\r\n@Entity\r\n@Table(name = \"ADDRESS\")\r\n@NamedQueries({ @NamedQuery(name = \"@HQL_GET_ALL_ADDRESS\", \r\n\t\t\tquery = \"from Address\") })\r\n@NamedNativeQueries({ @NamedNativeQuery(name = \"@SQL_GET_ALL_ADDRESS\", \r\n\t\t\tquery = \"select emp_id, address_line1, city, zipcode from Address\") })\r\npublic class Address {\r\n\r\n\t@Id\r\n\t@Column(name = \"emp_id\", unique = true, nullable = false)\r\n\t@GeneratedValue(generator = \"gen\")\r\n\t@GenericGenerator(name = \"gen\", strategy = \"foreign\", parameters = { @Parameter(name = \"property\", value = \"employee\") })\r\n\tprivate long id;\r\n\r\n\t@Column(name = \"address_line1\")\r\n\tprivate String addressLine1;\r\n\r\n\t@Column(name = \"zipcode\")\r\n\tprivate String zipcode;\r\n\r\n\t@Column(name = \"city\")\r\n\tprivate String city;\r\n\r\n\t@OneToOne\r\n\t@PrimaryKeyJoinColumn\r\n\tprivate Employee employee;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic String getAddressLine1() {\r\n\t\treturn addressLine1;\r\n\t}\r\n\r\n\tpublic void setAddressLine1(String addressLine1) {\r\n\t\tthis.addressLine1 = addressLine1;\r\n\t}\r\n\r\n\tpublic String getZipcode() {\r\n\t\treturn zipcode;\r\n\t}\r\n\r\n\tpublic void setZipcode(String zipcode) {\r\n\t\tthis.zipcode = zipcode;\r\n\t}\r\n\r\n\tpublic String getCity() {\r\n\t\treturn city;\r\n\t}\r\n\r\n\tpublic void setCity(String city) {\r\n\t\tthis.city = city;\r\n\t}\r\n\r\n\tpublic Employee getEmployee() {\r\n\t\treturn employee;\r\n\t}\r\n\r\n\tpublic void setEmployee(Employee employee) {\r\n\t\tthis.employee = employee;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn \"AddressLine1= \" + addressLine1 + \", City=\" + city\r\n\t\t\t\t+ \", Zipcode=\" + zipcode;\r\n\t}\r\n}\r\n<\/code><\/pre>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u3092\u8a00\u3044\u63db\u3048\u307e\u3059\u3002\uff11\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3060\u3051\u3092\u4f7f\u7528\u3057\u307e\u3059\uff1a<br \/>\nHibernate\u306eNamed Query\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0<\/h3>\n<p>\u4e0a\u8a18\u3067\u5b9a\u7fa9\u3055\u308c\u305f\u3059\u3079\u3066\u306eHibernate\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.hibernate.main;\r\n\r\nimport java.util.List;\r\n\r\nimport org.hibernate.Query;\r\nimport org.hibernate.Session;\r\nimport org.hibernate.SessionFactory;\r\nimport org.hibernate.Transaction;\r\n\r\nimport com.scdev.hibernate.model.Address;\r\nimport com.scdev.hibernate.model.Employee;\r\nimport com.scdev.hibernate.util.HibernateUtil;\r\n\r\npublic class HibernateNamedQueryExample {\r\n\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic static void main(String[] args) {\r\n\r\n\t\t\/\/ Prep work\r\n\t\tSessionFactory sessionFactory = HibernateUtil.getSessionFactory();\r\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tTransaction tx = session.beginTransaction();\r\n\r\n\t\t\/\/HQL Named Query Example\r\n\t\tQuery query = session.getNamedQuery(\"HQL_GET_ALL_EMPLOYEE\");\r\n\t\tList&lt;Employee&gt; empList = query.list();\r\n\t\tfor (Employee emp : empList) {\r\n\t\t\tSystem.out.println(\"List of Employees::\" + emp.getId() + \",\"\r\n\t\t\t\t\t+ emp.getAddress().getCity());\r\n\t\t}\r\n\r\n\t\tquery = session.getNamedQuery(\"HQL_GET_EMPLOYEE_BY_ID\");\r\n\t\tquery.setInteger(\"id\", 2);\r\n\t\tEmployee emp = (Employee) query.uniqueResult();\r\n\t\tSystem.out.println(\"Employee Name=\" + emp.getName() + \", City=\"\r\n\t\t\t\t+ emp.getAddress().getCity());\r\n\r\n\t\tquery = session.getNamedQuery(\"HQL_GET_EMPLOYEE_BY_SALARY\");\r\n\t\tquery.setInteger(\"salary\", 200);\r\n\t\tempList = query.list();\r\n\t\tfor (Employee emp1 : empList) {\r\n\t\t\tSystem.out.println(\"List of Employees::\" + emp1.getId() + \",\"\r\n\t\t\t\t\t+ emp1.getSalary());\r\n\t\t}\r\n\r\n\t\tquery = session.getNamedQuery(\"@HQL_GET_ALL_ADDRESS\");\r\n\t\tList&lt;Address&gt; addressList = query.list();\r\n\t\tfor (Address addr : addressList) {\r\n\t\t\tSystem.out.println(\"List of Address::\" + addr.getId() + \"::\"\r\n\t\t\t\t\t+ addr.getZipcode() + \"::\" + addr.getEmployee().getName());\r\n\t\t}\r\n\t\t\r\n\t\t\/\/Native SQL Named Query Example\r\n\t\tquery = session.getNamedQuery(\"@SQL_GET_ALL_ADDRESS\");\r\n\t\tList&lt;Object[]&gt; addressObjArray = query.list();\r\n\t\tfor(Object[] row : addressObjArray){\r\n\t\t\tfor(Object obj : row){\r\n\t\t\t\tSystem.out.print(obj + \"::\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\\n\");\r\n\t\t}\r\n\t\t\r\n\t\tquery = session.getNamedQuery(\"SQL_GET_ALL_EMP_ADDRESS\");\r\n\t\taddressObjArray = query.list();\r\n\t\tfor(Object[] row : addressObjArray){\r\n\t\t\tEmployee e = (Employee) row[0];\r\n\t\t\tSystem.out.println(\"Employee Info::\"+e);\r\n\t\t\tAddress a = (Address) row[1];\r\n\t\t\tSystem.out.println(\"Address Info::\"+a);\r\n\t\t}\r\n\t\t\/\/ rolling back to save the test data\r\n\t\ttx.commit();\r\n\r\n\t\t\/\/ closing hibernate resources\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\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3067\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>Hibernate: select employee0_.emp_id as emp_id1_1_, employee0_.emp_name as emp_name2_1_, employee0_.emp_salary as emp_sala3_1_ from EMPLOYEE employee0_\r\nHibernate: select address0_.emp_id as emp_id1_0_0_, address0_.address_line1 as address_2_0_0_, address0_.city as city3_0_0_, address0_.zipcode as zipcode4_0_0_, employee1_.emp_id as emp_id1_1_1_, employee1_.emp_name as emp_name2_1_1_, employee1_.emp_salary as emp_sala3_1_1_ from ADDRESS address0_ left outer join EMPLOYEE employee1_ on address0_.emp_id=employee1_.emp_id where address0_.emp_id=?\r\nHibernate: select address0_.emp_id as emp_id1_0_0_, address0_.address_line1 as address_2_0_0_, address0_.city as city3_0_0_, address0_.zipcode as zipcode4_0_0_, employee1_.emp_id as emp_id1_1_1_, employee1_.emp_name as emp_name2_1_1_, employee1_.emp_salary as emp_sala3_1_1_ from ADDRESS address0_ left outer join EMPLOYEE employee1_ on address0_.emp_id=employee1_.emp_id where address0_.emp_id=?\r\nHibernate: select address0_.emp_id as emp_id1_0_0_, address0_.address_line1 as address_2_0_0_, address0_.city as city3_0_0_, address0_.zipcode as zipcode4_0_0_, employee1_.emp_id as emp_id1_1_1_, employee1_.emp_name as emp_name2_1_1_, employee1_.emp_salary as emp_sala3_1_1_ from ADDRESS address0_ left outer join EMPLOYEE employee1_ on address0_.emp_id=employee1_.emp_id where address0_.emp_id=?\r\nHibernate: select address0_.emp_id as emp_id1_0_0_, address0_.address_line1 as address_2_0_0_, address0_.city as city3_0_0_, address0_.zipcode as zipcode4_0_0_, employee1_.emp_id as emp_id1_1_1_, employee1_.emp_name as emp_name2_1_1_, employee1_.emp_salary as emp_sala3_1_1_ from ADDRESS address0_ left outer join EMPLOYEE employee1_ on address0_.emp_id=employee1_.emp_id where address0_.emp_id=?\r\nList of Employees::1,San Jose\r\nList of Employees::2,Santa Clara\r\nList of Employees::3,Bangalore\r\nList of Employees::4,New Delhi\r\nHibernate: select employee0_.emp_id as emp_id1_1_, employee0_.emp_name as emp_name2_1_, employee0_.emp_salary as emp_sala3_1_ from EMPLOYEE employee0_ where emp_id=?\r\nEmployee Name=David, City=Santa Clara\r\nHibernate: select employee0_.emp_id as emp_id1_1_, employee0_.emp_name as emp_name2_1_, employee0_.emp_salary as emp_sala3_1_ from EMPLOYEE employee0_ where emp_salary&gt;?\r\nList of Employees::3,300.0\r\nList of Employees::4,400.0\r\nHibernate: select address0_.emp_id as emp_id1_0_, address0_.address_line1 as address_2_0_, address0_.city as city3_0_, address0_.zipcode as zipcode4_0_ from ADDRESS address0_\r\nList of Address::1::95129::Pankaj\r\nList of Address::2::95051::David\r\nList of Address::3::560100::Lisa\r\nList of Address::4::100100::Jack\r\nHibernate: select emp_id, address_line1, city, zipcode from Address\r\n1::Albany Dr::San Jose::95129::\r\n\r\n2::Arques Ave::Santa Clara::95051::\r\n\r\n3::BTM 1st Stage::Bangalore::560100::\r\n\r\n4::City Centre::New Delhi::100100::\r\n\r\nHibernate: select e.emp_id as emp_id1_1_0_, e.emp_name as emp_name2_1_0_, e.emp_salary as emp_sala3_1_0_, a.emp_id as emp_id1_0_1_, a.address_line1 as address_2_0_1_, a.city as city3_0_1_, a.zipcode as zipcode4_0_1_ from Employee e join Address a ON e.emp_id=a.emp_id\r\nEmployee Info::Id= 1, Name= Pankaj, Salary= 100.0, {Address= AddressLine1= Albany Dr, City=San Jose, Zipcode=95129}\r\nAddress Info::AddressLine1= Albany Dr, City=San Jose, Zipcode=95129\r\nEmployee Info::Id= 2, Name= David, Salary= 200.0, {Address= AddressLine1= Arques Ave, City=Santa Clara, Zipcode=95051}\r\nAddress Info::AddressLine1= Arques Ave, City=Santa Clara, Zipcode=95051\r\nEmployee Info::Id= 3, Name= Lisa, Salary= 300.0, {Address= AddressLine1= BTM 1st Stage, City=Bangalore, Zipcode=560100}\r\nAddress Info::AddressLine1= BTM 1st Stage, City=Bangalore, Zipcode=560100\r\nEmployee Info::Id= 4, Name= Jack, Salary= 400.0, {Address= AddressLine1= City Centre, City=New Delhi, Zipcode=100100}\r\nAddress Info::AddressLine1= City Centre, City=New Delhi, Zipcode=100100\r\n<\/code><\/pre>\n<h3>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u4ee5\u4e0b\u306e\u6587\u3092\u8a00\u3044\u63db\u3048\u307e\u3057\u3087\u3046\u30021\u3064\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u7d50\u69cb\u3067\u3059\u3002<br \/>\nHibernate\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306e\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8<\/h3>\n<p>\u30cf\u30a4\u30d0\u30cd\u30fc\u30c8\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306b\u3064\u3044\u3066\u306e\u6ce8\u76ee\u3059\u3079\u304d\u30dd\u30a4\u30f3\u30c8\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff1a<\/ol>\n<\/li>\n<\/ol>\n<p>Hibernate\u306eNamed Query\u306f\u3001\u30b3\u30fc\u30c9\u5168\u4f53\u306b\u6563\u3089\u3070\u3089\u305b\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u4e2d\u592e\u306e\u5834\u6240\u3067\u30af\u30a8\u30ea\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u305f\u3081\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<br \/>\nHibernate\u306eNamed Query\u306e\u69cb\u6587\u306f\u3001Hibernate\u30bb\u30c3\u30b7\u30e7\u30f3\u30d5\u30a1\u30af\u30c8\u30ea\u304c\u4f5c\u6210\u3055\u308c\u305f\u6642\u306b\u30c1\u30a7\u30c3\u30af\u3055\u308c\u308b\u305f\u3081\u3001\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\u306b\u30a8\u30e9\u30fc\u304c\u3042\u308b\u5834\u5408\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u901f\u3084\u304b\u306b\u30a8\u30e9\u30fc\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\nHibernate\u306eNamed Query\u306f\u30b0\u30ed\u30fc\u30d0\u30eb\u3067\u3042\u308a\u3001\u4e00\u5ea6\u5b9a\u7fa9\u3059\u308c\u3070\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u5168\u4f53\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\nNamed Query\u306e\u4e3b\u306a\u30c7\u30e1\u30ea\u30c3\u30c8\u306e1\u3064\u306f\u3001\u5b9a\u7fa9\u3055\u308c\u305f\u5834\u6240\u3092\u898b\u3064\u3051\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u30c7\u30d0\u30c3\u30b0\u304c\u56f0\u96e3\u3067\u3042\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>Hibernate\u306eNamed Query\u306e\u4f8b\u306f\u4ee5\u4e0a\u3067\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d2\u30d9\u30eb\u30cd\u30fc\u30c8\u306e\u540d\u524d\u4ed8\u304d\u30af\u30a8\u30ea\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>\u3088\u3046\u3053\u305d\u3001Hibernate Named Query\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3078\u3002HQL\u3068Native SQL Query\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u898b\u3066\u304d\u307e\u3057\u305f\u3002\u3082\u3057\u591a\u304f\u306e\u30af\u30a8\u30ea\u304c\u3042\u308b\u5834\u5408\u3001\u305d\u308c\u3089\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5168\u4f53\u306b\u6563\u3089\u3070\u3063\u3066\u3057\u307e\u3044\u3001\u30b3\u30fc\u30c9\u306e\u6563 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-948","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>\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1ahibernate-named-query\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\" \/>\n<meta property=\"og:description\" content=\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1ahibernate-named-query\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-17T10:55:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T18:45:55+00:00\" \/>\n<meta name=\"author\" content=\"\u5149, \u660e\" \/>\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=\"\u5149, \u660e\" \/>\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\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/\",\"name\":\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-08-17T10:55:03+00:00\",\"dateModified\":\"2025-07-31T18:45:55+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55\"},\"description\":\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b &#8211; @NamedQuery\"}]},{\"@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\/9ee62cea876d247deba14a0ac7ba5b55\",\"name\":\"\u5149, \u660e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g\",\"caption\":\"\u5149, \u660e\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery - Blog - Silicon Cloud","description":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1ahibernate-named-query\/","og_locale":"ja_JP","og_type":"article","og_title":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery","og_description":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1ahibernate-named-query\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-08-17T10:55:03+00:00","article_modified_time":"2025-07-31T18:45:55+00:00","author":"\u5149, \u660e","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u5149, \u660e","\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\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/","name":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-08-17T10:55:03+00:00","dateModified":"2025-07-31T18:45:55+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/9ee62cea876d247deba14a0ac7ba5b55"},"description":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b - @NamedQuery\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\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"\u30cd\u30a4\u30c6\u30a3\u30d6\u306a\u65e5\u672c\u8a9e\u3067\u306e\u30d1\u30e9\u30d5\u30ec\u30fc\u30ba\u4f8b\uff1aHibernate Named Query\u306e\u5229\u7528\u4f8b &#8211; @NamedQuery"}]},{"@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\/9ee62cea876d247deba14a0ac7ba5b55","name":"\u5149, \u660e","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3dffb6c754b95e3fbdcd8973f4375ff9dd10d41e4f6632ad08d4d59ccc35af8d?s=96&d=mm&r=g","caption":"\u5149, \u660e"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/hikariakira\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/%e3%83%8d%e3%82%a4%e3%83%86%e3%82%a3%e3%83%96%e3%81%aa%e6%97%a5%e6%9c%ac%e8%aa%9e%e3%81%a7%e3%81%ae%e3%83%91%e3%83%a9%e3%83%95%e3%83%ac%e3%83%bc%e3%82%ba%e4%be%8b%ef%bc%9ahibernate-named-query\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/948","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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=948"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/948\/revisions"}],"predecessor-version":[{"id":47017,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/948\/revisions\/47017"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=948"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=948"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=948"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}