Hibernate SVN: r18513 - core/trunk/documentation/manual/src/main/docbook/ko-KR/content.
by hibernate-commits@lists.jboss.org
Author: jdkim528
Date: 2010-01-12 07:01:32 -0500 (Tue, 12 Jan 2010)
New Revision: 18513
Modified:
core/trunk/documentation/manual/src/main/docbook/ko-KR/content/association_mapping.po
Log:
translated!
Modified: core/trunk/documentation/manual/src/main/docbook/ko-KR/content/association_mapping.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ko-KR/content/association_mapping.po 2010-01-12 11:36:49 UTC (rev 18512)
+++ core/trunk/documentation/manual/src/main/docbook/ko-KR/content/association_mapping.po 2010-01-12 12:01:32 UTC (rev 18513)
@@ -3,8 +3,8 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-07-14 19:55+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2010-01-12 20:59+0900\n"
+"Last-Translator: Jongdae Kim <jdkim528(a)korea.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -24,42 +24,21 @@
#. Tag: para
#: association_mapping.xml:35
-#, fuzzy, no-c-format
-msgid ""
-"Association mappings are often the most difficult thing to implement "
-"correctly. In this section we examine some canonical cases one by one, "
-"starting with unidirectional mappings and then bidirectional cases. We will "
-"use <literal>Person</literal> and <literal>Address</literal> in all the "
-"examples."
-msgstr ""
-"연관 매핑들은 올바른 것을 얻기가 종종 가장 어려운 것이다. 이 절에서 우리는 단"
-"방향 매핑들에서 시작하고, 그런 다음 양방향 경우들을 검토함으로써, 하나씩 표준"
-"적인 경우들을 상세히 논의할 것이다. 우리는 모든 예제들에서 <literal>Person</"
-"literal>과 <literal>Address</literal>를 사용할 것이다."
+#, no-c-format
+msgid "Association mappings are often the most difficult thing to implement correctly. In this section we examine some canonical cases one by one, starting with unidirectional mappings and then bidirectional cases. We will use <literal>Person</literal> and <literal>Address</literal> in all the examples."
+msgstr "연관 매핑들은 종종 정확하게 구현하는 것이 가장 어려운 것이다. 이 절에서 우리는 단방향 매핑들에서 시작하여, 양방향 매핑의 경우까지 하나씩 몇몇 정규적인 경우들을 논의할 것이다. 우리는 모든 예제들에서 <literal>Person</literal>과 <literal>Address</literal>를 사용할 것이다."
#. Tag: para
#: association_mapping.xml:43
-#, fuzzy, no-c-format
-msgid ""
-"Associations will be classified by multiplicity and whether or not they map "
-"to an intervening join table."
-msgstr ""
-"우리는 연관들을 중재하는 join 테이블로 매핑시킬 것인지 여부에 따라, 그리고 "
-"multiplicity(다중성)에 따라 연관들을 분류할 것이다."
+#, no-c-format
+msgid "Associations will be classified by multiplicity and whether or not they map to an intervening join table."
+msgstr "연관들은 다가성 그리고 중재하는 join 테이블로 매핑시킬 것인지 여부에 따라 분류될 것이다."
#. Tag: para
#: association_mapping.xml:48
-#, fuzzy, no-c-format
-msgid ""
-"Nullable foreign keys are not considered to be good practice in traditional "
-"data modelling, so our examples do not use nullable foreign keys. This is "
-"not a requirement of Hibernate, and the mappings will work if you drop the "
-"nullability constraints."
-msgstr ""
-"null 허용 가능한 foreign 키들은 전통적인 데이터 모델링에서 좋은 실례로 간주되"
-"지 않아서, 모든 우리의 예제들은 not null foreign 키들을 사용한다. 이것은 "
-"Hibernate에서 필수가 아니고, 당신이 null 허용 가능 컨스트레인트들을 드롭시킬 "
-"경우 매핑들은 모두 동작할 것이다."
+#, no-c-format
+msgid "Nullable foreign keys are not considered to be good practice in traditional data modelling, so our examples do not use nullable foreign keys. This is not a requirement of Hibernate, and the mappings will work if you drop the nullability constraints."
+msgstr "널값이 허용되는 외래 키들은 전통적인 데이터 모델링에서 좋은 사례로 간주되지 않으므로, 우리의 예제들은 널 값이 허용되는 외래 키들을 사용하지 않는다. 이것은 하이버네이트의 사양이 아니며, 당신이 널 허용 컨스트레인트들을 드롭시킬 경우에 매핑들이 동작할 것이다."
#. Tag: title
#: association_mapping.xml:58
@@ -68,20 +47,17 @@
msgstr "단방향 연관들"
#. Tag: title
-#: association_mapping.xml:61 association_mapping.xml:132
-#, fuzzy, no-c-format
+#: association_mapping.xml:61
+#: association_mapping.xml:132
+#, no-c-format
msgid "Many-to-one"
-msgstr "many to one"
+msgstr "다-대-일"
#. Tag: para
#: association_mapping.xml:63
#, no-c-format
-msgid ""
-"A <emphasis>unidirectional many-to-one association</emphasis> is the most "
-"common kind of unidirectional association."
-msgstr ""
-"<emphasis>단방향 many-to-one 연관</emphasis>은 가장 공통적인 종류의 단방향 연"
-"관이다."
+msgid "A <emphasis>unidirectional many-to-one association</emphasis> is the most common kind of unidirectional association."
+msgstr "<emphasis>단방향 many-to-one 연관</emphasis>은 가장 공통적인 종류의 단방향 연관이다."
#. Tag: programlisting
#: association_mapping.xml:68
@@ -102,35 +78,49 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <many-to-one name=\"address\" \n"
+" column=\"addressId\"\n"
+" not-null=\"true\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
-#: association_mapping.xml:69 association_mapping.xml:185
+#: association_mapping.xml:69
+#: association_mapping.xml:185
#, no-c-format
msgid ""
"<![CDATA[\n"
-"create table Person ( personId bigint not null primary key, addressId bigint "
-"not null )\n"
+"create table Person ( personId bigint not null primary key, addressId bigint not null )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key, addressId bigint not null )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: title
-#: association_mapping.xml:74 association_mapping.xml:145
+#: association_mapping.xml:74
+#: association_mapping.xml:145
#: association_mapping.xml:210
-#, fuzzy, no-c-format
+#, no-c-format
msgid "One-to-one"
-msgstr "one to one"
+msgstr "일-대-일"
#. Tag: para
#: association_mapping.xml:76
#, no-c-format
-msgid ""
-"A <emphasis>unidirectional one-to-one association on a foreign key</"
-"emphasis> is almost identical. The only difference is the column unique "
-"constraint."
-msgstr ""
-"<emphasis>foreign 키에 대한 단방향 one-to-one 연관은 대개 아주 동일하다.</"
-"emphasis> 유일한 차이점은 컬럼 유일(unique) 컨스트레인트이다."
+msgid "A <emphasis>unidirectional one-to-one association on a foreign key</emphasis> is almost identical. The only difference is the column unique constraint."
+msgstr "<emphasis>foreign 키에 대한 단방향 one-to-one 연관은 대개 아주 동일하다.</emphasis> 유일한 차이점은 컬럼 유일(unique) 컨스트레인트이다."
#. Tag: programlisting
#: association_mapping.xml:81
@@ -152,29 +142,42 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <many-to-one name=\"address\" \n"
+" column=\"addressId\" \n"
+" unique=\"true\"\n"
+" not-null=\"true\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
-#: association_mapping.xml:82 association_mapping.xml:218
+#: association_mapping.xml:82
+#: association_mapping.xml:218
#, no-c-format
msgid ""
"<![CDATA[\n"
-"create table Person ( personId bigint not null primary key, addressId bigint "
-"not null unique )\n"
+"create table Person ( personId bigint not null primary key, addressId bigint not null unique )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key, addressId bigint not null unique )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: para
#: association_mapping.xml:84
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>unidirectional one-to-one association on a primary key</"
-"emphasis> usually uses a special id generator In this example, however, we "
-"have reversed the direction of the association:"
-msgstr ""
-"<emphasis>하나의 프라이머리 키에 대한 단방향 one-to-one 연관</emphasis>은 대"
-"개 특별한 id 생성기를 사용한다. (이 예제에서 연관의 방향이 역전되었음을 주목"
-"하라.)"
+#, no-c-format
+msgid "A <emphasis>unidirectional one-to-one association on a primary key</emphasis> usually uses a special id generator In this example, however, we have reversed the direction of the association:"
+msgstr "<emphasis>프라이머리 키에 대한 단방향 일-대-일 연관</emphasis>은 대개 특별한 id 생성자를 사용한다. 하지만 이 예제에서 우리는 연관의 방향을 역전시켰다:"
#. Tag: programlisting
#: association_mapping.xml:90
@@ -195,9 +198,24 @@
" <one-to-one name=\"person\" constrained=\"true\"/>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">person</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"person\" constrained=\"true\"/>\n"
+"</class>]]>"
#. Tag: programlisting
-#: association_mapping.xml:91 association_mapping.xml:226
+#: association_mapping.xml:91
+#: association_mapping.xml:226
#, no-c-format
msgid ""
"<![CDATA[\n"
@@ -205,22 +223,23 @@
"create table Address ( personId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table Address ( personId bigint not null primary key )\n"
+" ]]>"
#. Tag: title
-#: association_mapping.xml:96 association_mapping.xml:118
-#, fuzzy, no-c-format
+#: association_mapping.xml:96
+#: association_mapping.xml:118
+#, no-c-format
msgid "One-to-many"
-msgstr "one to many"
+msgstr "일-대-다 "
#. Tag: para
#: association_mapping.xml:98
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>unidirectional one-to-many association on a foreign key</"
-"emphasis> is an unusual case, and is not recommended."
-msgstr ""
-"<emphasis>하나의 foreign 키에 대한 단방향 one-to-many 연관</emphasis>은 매우 "
-"색다른 경우이고, 실제로 권장되지 않는다."
+#, no-c-format
+msgid "A <emphasis>unidirectional one-to-many association on a foreign key</emphasis> is an unusual case, and is not recommended."
+msgstr "<emphasis>외래 키에 대한 단방향 일-대-다 연관</emphasis>은 색다른 경우이며, 권장되지 않는다."
#. Tag: programlisting
#: association_mapping.xml:103
@@ -243,6 +262,22 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"addresses\">\n"
+" <key column=\"personId\" \n"
+" not-null=\"true\"/>\n"
+" <one-to-many class=\"Address\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
#: association_mapping.xml:104
@@ -250,18 +285,19 @@
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table Address ( addressId bigint not null primary key, personId "
-"bigint not null )\n"
+"create table Address ( addressId bigint not null primary key, personId bigint not null )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table Address ( addressId bigint not null primary key, personId bigint not null )\n"
+" ]]>"
#. Tag: para
#: association_mapping.xml:106
-#, fuzzy, no-c-format
+#, no-c-format
msgid "You should instead use a join table for this kind of association."
-msgstr ""
-"우리는 이런 종류의 연관에 대해 하나의 join 테이블을 사용하는 것이 더 좋다고 "
-"생각한다."
+msgstr "대신에 당신은 이런 종류의 연관에 대해 하나의 join 테이블을 사용해야 한다."
#. Tag: title
#: association_mapping.xml:115
@@ -271,15 +307,9 @@
#. Tag: para
#: association_mapping.xml:120
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>unidirectional one-to-many association on a join table</"
-"emphasis> is the preferred option. Specifying <literal>unique=\"true\"</"
-"literal>, changes the multiplicity from many-to-many to one-to-many."
-msgstr ""
-"<emphasis>하나의 join 테이블에 대한 단방향 one-to-many 연관</emphasis>이 보"
-"다 더 선호된다. <literal>unique=\"true\"</literal>를 지정함으로써 우리는 "
-"many-to-many에서 one-to-many로 아중성(multiplicity)를 변경시켰음을 주목하라."
+#, no-c-format
+msgid "A <emphasis>unidirectional one-to-many association on a join table</emphasis> is the preferred option. Specifying <literal>unique=\"true\"</literal>, changes the multiplicity from many-to-many to one-to-many."
+msgstr "<emphasis>join 테이블에 대한 단방향 일-대-다 연관</emphasis>은 선호되는 옵션이다. <literal>unique=\"true\"</literal>를 지정하여, 다-대-다에서 일-대-다로 다중값을 변경시켜라."
#. Tag: programlisting
#: association_mapping.xml:126
@@ -303,6 +333,23 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"addresses\" table=\"PersonAddress\">\n"
+" <key column=\"personId\"/>\n"
+" <many-to-many column=\"addressId\"\n"
+" unique=\"true\"\n"
+" class=\"Address\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
#: association_mapping.xml:127
@@ -310,21 +357,21 @@
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table PersonAddress ( personId not null, addressId bigint not null "
-"primary key )\n"
+"create table PersonAddress ( personId not null, addressId bigint not null primary key )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table PersonAddress ( personId not null, addressId bigint not null primary key )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: para
#: association_mapping.xml:134
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>unidirectional many-to-one association on a join table</"
-"emphasis> is common when the association is optional. For example:"
-msgstr ""
-"<emphasis>하나의 join 테이블에 대한 단방향 many-to-one 연관</emphasis>은 그 "
-"연관이 선택적일 때 매우 공통적이다."
+#, no-c-format
+msgid "A <emphasis>unidirectional many-to-one association on a join table</emphasis> is common when the association is optional. For example:"
+msgstr "<emphasis>join 테이블에 대한 단방향 다-대-일 연관</emphasis>은 그 연관이 선택적일 때 공통적이다. 예를 들면:"
#. Tag: programlisting
#: association_mapping.xml:139
@@ -349,6 +396,24 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <join table=\"PersonAddress\" \n"
+" optional=\"true\">\n"
+" <key column=\"personId\" unique=\"true\"/>\n"
+" <many-to-one name=\"address\"\n"
+" column=\"addressId\" \n"
+" not-null=\"true\"/>\n"
+" </join>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
#: association_mapping.xml:140
@@ -356,21 +421,21 @@
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table PersonAddress ( personId bigint not null primary key, addressId "
-"bigint not null )\n"
+"create table PersonAddress ( personId bigint not null primary key, addressId bigint not null )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table PersonAddress ( personId bigint not null primary key, addressId bigint not null )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: para
#: association_mapping.xml:147
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>unidirectional one-to-one association on a join table</emphasis> "
-"is possible, but extremely unusual."
-msgstr ""
-"<emphasis>하나의 join 테이블에 대한 단방향 one-to-one 연관</emphasis>은 극히 "
-"통상적이지 않지만 가능하다."
+#, no-c-format
+msgid "A <emphasis>unidirectional one-to-one association on a join table</emphasis> is possible, but extremely unusual."
+msgstr "<emphasis>join 테이블에 대한 단방향 일-대-일 연관</emphasis>은 가능하지만, 극히 통상적이지 않다."
#. Tag: programlisting
#: association_mapping.xml:152
@@ -397,33 +462,56 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <join table=\"PersonAddress\" \n"
+" optional=\"true\">\n"
+" <key column=\"personId\" \n"
+" unique=\"true\"/>\n"
+" <many-to-one name=\"address\"\n"
+" column=\"addressId\" \n"
+" not-null=\"true\"\n"
+" unique=\"true\"/>\n"
+" </join>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
-#: association_mapping.xml:153 association_mapping.xml:258
+#: association_mapping.xml:153
+#: association_mapping.xml:258
#, no-c-format
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table PersonAddress ( personId bigint not null primary key, addressId "
-"bigint not null unique )\n"
+"create table PersonAddress ( personId bigint not null primary key, addressId bigint not null unique )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table PersonAddress ( personId bigint not null primary key, addressId bigint not null unique )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: title
-#: association_mapping.xml:158 association_mapping.xml:263
-#, fuzzy, no-c-format
+#: association_mapping.xml:158
+#: association_mapping.xml:263
+#, no-c-format
msgid "Many-to-many"
-msgstr "many to many"
+msgstr "다-대-다"
#. Tag: para
#: association_mapping.xml:160
-#, fuzzy, no-c-format
-msgid ""
-"Finally, here is an example of a <emphasis>unidirectional many-to-many "
-"association</emphasis>."
-msgstr ""
-"마지막으로, 우리는 <emphasis>단방향 many-to-many 연관</emphasis>을 갖는다."
+#, no-c-format
+msgid "Finally, here is an example of a <emphasis>unidirectional many-to-many association</emphasis>."
+msgstr "마지막으로, 다음은 <emphasis>단방향 다-대-다 연관</emphasis>에 대한 예제이다."
#. Tag: programlisting
#: association_mapping.xml:164
@@ -446,18 +534,39 @@
" </id>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"addresses\" table=\"PersonAddress\">\n"
+" <key column=\"personId\"/>\n"
+" <many-to-many column=\"addressId\"\n"
+" class=\"Address\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+"</class>]]>"
#. Tag: programlisting
-#: association_mapping.xml:165 association_mapping.xml:271
+#: association_mapping.xml:165
+#: association_mapping.xml:271
#, no-c-format
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table PersonAddress ( personId bigint not null, addressId bigint not "
-"null, primary key (personId, addressId) )\n"
+"create table PersonAddress ( personId bigint not null, addressId bigint not null, primary key (personId, addressId) )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table PersonAddress ( personId bigint not null, addressId bigint not null, primary key (personId, addressId) )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: title
#: association_mapping.xml:172
@@ -466,21 +575,17 @@
msgstr "양방향 연관들"
#. Tag: title
-#: association_mapping.xml:175 association_mapping.xml:236
-#, fuzzy, no-c-format
+#: association_mapping.xml:175
+#: association_mapping.xml:236
+#, no-c-format
msgid "one-to-many / many-to-one"
-msgstr "one to many / many to one"
+msgstr "일-대-다 / 다-대-일"
#. Tag: para
#: association_mapping.xml:177
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>bidirectional many-to-one association</emphasis> is the most "
-"common kind of association. The following example illustrates the standard "
-"parent/child relationship."
-msgstr ""
-"<emphasis>양방향 many-to-one 연관</emphasis>은 가장 공통된 종류의 연관이다."
-"(이것은 표준 부모/자식 관계이다. )"
+#, no-c-format
+msgid "A <emphasis>bidirectional many-to-one association</emphasis> is the most common kind of association. The following example illustrates the standard parent/child relationship."
+msgstr "<emphasis>양방향 다-대-일 연관</emphasis>은 가장 공통된 종류의 연관이다. 다음 예제는 표준 부모/자식 관계를 설명한다."
#. Tag: programlisting
#: association_mapping.xml:183
@@ -505,24 +610,30 @@
" </set>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <many-to-one name=\"address\" \n"
+" column=\"addressId\"\n"
+" not-null=\"true\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"people\" inverse=\"true\">\n"
+" <key column=\"addressId\"/>\n"
+" <one-to-many class=\"Person\"/>\n"
+" </set>\n"
+"</class>]]>"
#. Tag: para
#: association_mapping.xml:187
-#, fuzzy, no-c-format
-msgid ""
-"If you use a <literal>List</literal>, or other indexed collection, set the "
-"<literal>key</literal> column of the foreign key to <literal>not null</"
-"literal>. Hibernate will manage the association from the collections side to "
-"maintain the index of each element, making the other side virtually inverse "
-"by setting <literal>update=\"false\"</literal> and <literal>insert=\"false"
-"\"</literal>:"
-msgstr ""
-"만일 당신이 <literal>List</literal>(또는 다른 인덱싱 된 콜렉션)을 사용할 경"
-"우 당신은 foreign key의 <literal>key</literal> 컬럼을 <literal>not null</"
-"literal>로 설정하고, Hibernate로 하여금 각각의 요소의 인덱스를 유지관리하기 "
-"위해 (<literal>update=\"false\"</literal>와 <literal>insert=\"false\"</"
-"literal>를 설정함으로써 다른 측을 가상적으로 inverse로 만들어) 그 콜렉션들 측"
-"으로부터 연관을 관리하도록 할 필요가 있다:"
+#, no-c-format
+msgid "If you use a <literal>List</literal>, or other indexed collection, set the <literal>key</literal> column of the foreign key to <literal>not null</literal>. Hibernate will manage the association from the collections side to maintain the index of each element, making the other side virtually inverse by setting <literal>update=\"false\"</literal> and <literal>insert=\"false\"</literal>:"
+msgstr "만일 당신이 <literal>List</literal>, 또는 다른 인덱싱 된 콜렉션을 사용할 경우, 외래 키의 <literal>key</literal> 컬럼을 <literal>not null</literal>로 설정하라. 하이버네이트는 각각의 요소의 인덱스를 관리하기 위해 <literal>update=\"false\"</literal>와 <literal>insert=\"false\"</literal>를 설정하여 다른 측을 가상적으로 역행시킴으로서 콜렉션들 측에서 그 연관을 관리할 것이다:"
#. Tag: programlisting
#: association_mapping.xml:195
@@ -548,32 +659,37 @@
" </list>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\"/>\n"
+" ...\n"
+" <many-to-one name=\"address\"\n"
+" column=\"addressId\"\n"
+" not-null=\"true\"\n"
+" insert=\"false\"\n"
+" update=\"false\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\"/>\n"
+" ...\n"
+" <list name=\"people\">\n"
+" <key column=\"addressId\" not-null=\"true\"/>\n"
+" <list-index column=\"peopleIdx\"/>\n"
+" <one-to-many class=\"Person\"/>\n"
+" </list>\n"
+"</class>]]>"
#. Tag: para
#: association_mapping.xml:197
-#, fuzzy, no-c-format
-msgid ""
-"If the underlying foreign key column is <literal>NOT NULL</literal>, it is "
-"important that you define <literal>not-null=\"true\"</literal> on the "
-"<literal><key></literal> element of the collection mapping. Do not "
-"only declare <literal>not-null=\"true\"</literal> on a possible nested "
-"<literal><column></literal> element, but on the <literal><key></"
-"literal> element."
-msgstr ""
-"만일 기본 외래 키 컬럼이 <literal>NOT NULL</literal>일 경우 콜렉션 매핑의 "
-"<literal><key></literal> 요소 상에 <literal>not-null=\"true\"</literal>"
-"를 정의하는 것이 중요하다. 내포된 <literal><column></literal> 요소 상"
-"에 <literal>not-null=\"true\"</literal>를 선언하지 말고, <literal><key>"
-"</literal> 요소 상에 선언하라."
+#, no-c-format
+msgid "If the underlying foreign key column is <literal>NOT NULL</literal>, it is important that you define <literal>not-null=\"true\"</literal> on the <literal><key></literal> element of the collection mapping. Do not only declare <literal>not-null=\"true\"</literal> on a possible nested <literal><column></literal> element, but on the <literal><key></literal> element."
+msgstr "만일 기본 외래 키 컬럼이 <literal>NOT NULL</literal>일 경우, 당신이 콜렉션 매핑의 <literal><key></literal>에 <literal>not-null=\"true\"</literal>를 정의하는 것이 중요하다. <literal>not-null=\"true\"</literal>를 가능한 내포된 <literal><column></literal> 요소 뿐만 아니라, <literal><key></literal> 요소 상에도 선언하라."
#. Tag: para
#: association_mapping.xml:212
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>bidirectional one-to-one association on a foreign key</emphasis> "
-"is common:"
-msgstr ""
-"<emphasis>foreign에 대한 양방향 one-to-one 연관</emphasis>은 꽤 공통적이다."
+#, no-c-format
+msgid "A <emphasis>bidirectional one-to-one association on a foreign key</emphasis> is common:"
+msgstr "<emphasis>외래 키에 대한 양방향일-대-일 연관</emphasis>은 공통적이다:"
#. Tag: programlisting
#: association_mapping.xml:217
@@ -597,16 +713,29 @@
" property-ref=\"address\"/>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <many-to-one name=\"address\" \n"
+" column=\"addressId\" \n"
+" unique=\"true\"\n"
+" not-null=\"true\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <one-to-one name=\"person\" \n"
+" property-ref=\"address\"/>\n"
+"</class>]]>"
#. Tag: para
#: association_mapping.xml:220
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>bidirectional one-to-one association on a primary key</emphasis> "
-"uses the special id generator:"
-msgstr ""
-"<emphasis>하나의 프라이머리 키에 대한 양방향 one-to-one 연관</emphasis>은 특"
-"별한 id 생성기를 사용한다."
+#, no-c-format
+msgid "A <emphasis>bidirectional one-to-one association on a primary key</emphasis> uses the special id generator:"
+msgstr "<emphasis>프라이머리 키에 대한 양방향 일-대-일 연관</emphasis>은 특별한 id 생성자를 사용한다:"
#. Tag: programlisting
#: association_mapping.xml:225
@@ -629,6 +758,22 @@
" constrained=\"true\"/>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <one-to-one name=\"address\"/>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"foreign\">\n"
+" <param name=\"property\">person</param>\n"
+" </generator>\n"
+" </id>\n"
+" <one-to-one name=\"person\" \n"
+" constrained=\"true\"/>\n"
+"</class>]]>"
#. Tag: title
#: association_mapping.xml:233
@@ -638,16 +783,9 @@
#. Tag: para
#: association_mapping.xml:238
-#, fuzzy, no-c-format
-msgid ""
-"The following is an example of a <emphasis>bidirectional one-to-many "
-"association on a join table</emphasis>. The <literal>inverse=\"true\"</"
-"literal> can go on either end of the association, on the collection, or on "
-"the join."
-msgstr ""
-"<emphasis>하나의 join 테이블에 대한 양방향 one-to-many 연관</emphasis>. "
-"<literal>inverse=\"true\"</literal>는 연관의 어느 쪽 끝이든 콜렉션 측으로 또"
-"는 join 측으로 갈 수 있다."
+#, no-c-format
+msgid "The following is an example of a <emphasis>bidirectional one-to-many association on a join table</emphasis>. The <literal>inverse=\"true\"</literal> can go on either end of the association, on the collection, or on the join."
+msgstr "다음은 <emphasis>join 테이블에 대한 양방향 일-대-다 연관</emphasis>에 대한 예제이다. <literal>inverse=\"true\"</literal>는 연관의 어느 측이든지, 콜렉션 측에도, 또는 join 측에도 쓸 수 있다."
#. Tag: programlisting
#: association_mapping.xml:244
@@ -680,6 +818,32 @@
" </join>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"addresses\" \n"
+" table=\"PersonAddress\">\n"
+" <key column=\"personId\"/>\n"
+" <many-to-many column=\"addressId\"\n"
+" unique=\"true\"\n"
+" class=\"Address\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <join table=\"PersonAddress\" \n"
+" inverse=\"true\" \n"
+" optional=\"true\">\n"
+" <key column=\"addressId\"/>\n"
+" <many-to-one name=\"person\"\n"
+" column=\"personId\"\n"
+" not-null=\"true\"/>\n"
+" </join>\n"
+"</class>]]>"
#. Tag: programlisting
#: association_mapping.xml:245
@@ -687,11 +851,15 @@
msgid ""
"<![CDATA[\n"
"create table Person ( personId bigint not null primary key )\n"
-"create table PersonAddress ( personId bigint not null, addressId bigint not "
-"null primary key )\n"
+"create table PersonAddress ( personId bigint not null, addressId bigint not null primary key )\n"
"create table Address ( addressId bigint not null primary key )\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+"create table Person ( personId bigint not null primary key )\n"
+"create table PersonAddress ( personId bigint not null, addressId bigint not null primary key )\n"
+"create table Address ( addressId bigint not null primary key )\n"
+" ]]>"
#. Tag: title
#: association_mapping.xml:250
@@ -701,13 +869,9 @@
#. Tag: para
#: association_mapping.xml:252
-#, fuzzy, no-c-format
-msgid ""
-"A <emphasis>bidirectional one-to-one association on a join table</emphasis> "
-"is possible, but extremely unusual."
-msgstr ""
-"<emphasis>하나의 join 테이블에 대한 양방향 one-to-one 연관</emphasis>은 극히 "
-"통상적이지 않지만, 가능하다."
+#, no-c-format
+msgid "A <emphasis>bidirectional one-to-one association on a join table</emphasis> is possible, but extremely unusual."
+msgstr "<emphasis>join 테이블에 대한 양방향 일-대-일 연관</emphasis>이 가능하지만, 극히 통상적이지 않다."
#. Tag: programlisting
#: association_mapping.xml:257
@@ -744,16 +908,42 @@
" </join>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <join table=\"PersonAddress\" \n"
+" optional=\"true\">\n"
+" <key column=\"personId\" \n"
+" unique=\"true\"/>\n"
+" <many-to-one name=\"address\"\n"
+" column=\"addressId\" \n"
+" not-null=\"true\"\n"
+" unique=\"true\"/>\n"
+" </join>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <join table=\"PersonAddress\" \n"
+" optional=\"true\"\n"
+" inverse=\"true\">\n"
+" <key column=\"addressId\" \n"
+" unique=\"true\"/>\n"
+" <many-to-one name=\"person\"\n"
+" column=\"personId\" \n"
+" not-null=\"true\"\n"
+" unique=\"true\"/>\n"
+" </join>\n"
+"</class>]]>"
#. Tag: para
#: association_mapping.xml:265
-#, fuzzy, no-c-format
-msgid ""
-"Here is an example of a <emphasis>bidirectional many-to-many association</"
-"emphasis>."
-msgstr ""
-"마지막으로, 우리는 하나의 <emphasis>양방향 many-to-many 연관</emphasis>을 갖"
-"는다."
+#, no-c-format
+msgid "Here is an example of a <emphasis>bidirectional many-to-many association</emphasis>."
+msgstr "이것은 <emphasis>양방향 다-대-다 연관</emphasis>에 대한 예제이다."
#. Tag: programlisting
#: association_mapping.xml:269
@@ -781,6 +971,27 @@
" </set>\n"
"</class>]]>"
msgstr ""
+"<![CDATA[<class name=\"Person\">\n"
+" <id name=\"id\" column=\"personId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"addresses\" table=\"PersonAddress\">\n"
+" <key column=\"personId\"/>\n"
+" <many-to-many column=\"addressId\"\n"
+" class=\"Address\"/>\n"
+" </set>\n"
+"</class>\n"
+"\n"
+"<class name=\"Address\">\n"
+" <id name=\"id\" column=\"addressId\">\n"
+" <generator class=\"native\"/>\n"
+" </id>\n"
+" <set name=\"people\" inverse=\"true\" table=\"PersonAddress\">\n"
+" <key column=\"addressId\"/>\n"
+" <many-to-many column=\"personId\"\n"
+" class=\"Person\"/>\n"
+" </set>\n"
+"</class>]]>"
#. Tag: title
#: association_mapping.xml:278
@@ -790,21 +1001,9 @@
#. Tag: para
#: association_mapping.xml:280
-#, fuzzy, no-c-format
-msgid ""
-"More complex association joins are <emphasis>extremely</emphasis> rare. "
-"Hibernate handles more complex situations by using SQL fragments embedded in "
-"the mapping document. For example, if a table with historical account "
-"information data defines <literal>accountNumber</literal>, "
-"<literal>effectiveEndDate</literal> and <literal>effectiveStartDate</"
-"literal>columns, it would be mapped as follows:"
-msgstr ""
-"보다 복잡한 연관 조인들은 <emphasis>극기</emphasis> 드물다. Hibernate는 매핑 "
-"문서들 내에 삽입된 SQL 조각들을 사용하여 보다 복잡한 상황을 처리하는 것을 가"
-"능하도록 해준다. 예를 들어, 만일 계좌 내역 정보 데이터를 가진 하나이 테이블"
-"이 <literal>accountNumber</literal>, <literal>effectiveEndDate</literal> 그리"
-"고 <literal>effectiveStartDate</literal> 컬럼들을 정의할 경우, 다음과 같이 매"
-"핑된다:"
+#, no-c-format
+msgid "More complex association joins are <emphasis>extremely</emphasis> rare. Hibernate handles more complex situations by using SQL fragments embedded in the mapping document. For example, if a table with historical account information data defines <literal>accountNumber</literal>, <literal>effectiveEndDate</literal> and <literal>effectiveStartDate</literal>columns, it would be mapped as follows:"
+msgstr "보다 복잡한 연관 join들은 <emphasis>극히</emphasis> 드물다. 하이버네이트는 매핑 문서들 내에 삽입된 SQL 조각들을 사용하여 보다 복잡한 상황들을 처리한다. 예를 들어, 만일 계좌 내역 정보 데이터를 가진 테이블이 <literal>accountNumber</literal>, <literal>effectiveEndDate</literal> 그리고 <literal>effectiveStartDate</literal> 컬럼들을 정의하고 있다면, 그것은 다음과 같이 매핑될 것이다:"
#. Tag: programlisting
#: association_mapping.xml:289
@@ -813,24 +1012,26 @@
"<![CDATA[<properties name=\"currentAccountKey\">\n"
" <property name=\"accountNumber\" type=\"string\" not-null=\"true\"/>\n"
" <property name=\"currentAccount\" type=\"boolean\">\n"
-" <formula>case when effectiveEndDate is null then 1 else 0 end</"
-"formula>\n"
+" <formula>case when effectiveEndDate is null then 1 else 0 end</formula>\n"
" </property>\n"
"</properties>\n"
"<property name=\"effectiveEndDate\" type=\"date\"/>\n"
"<property name=\"effectiveStateDate\" type=\"date\" not-null=\"true\"/>]]>"
msgstr ""
+"<![CDATA[<properties name=\"currentAccountKey\">\n"
+" <property name=\"accountNumber\" type=\"string\" not-null=\"true\"/>\n"
+" <property name=\"currentAccount\" type=\"boolean\">\n"
+" <formula>case when effectiveEndDate is null then 1 else 0 end</formula>\n"
+" </property>\n"
+"</properties>\n"
+"<property name=\"effectiveEndDate\" type=\"date\"/>\n"
+"<property name=\"effectiveStateDate\" type=\"date\" not-null=\"true\"/>]]>"
#. Tag: para
#: association_mapping.xml:291
-#, fuzzy, no-c-format
-msgid ""
-"You can then map an association to the <emphasis>current</emphasis> "
-"instance, the one with null <literal>effectiveEndDate</literal>, by using:"
-msgstr ""
-"그때 우리는 다음을 사용하여 하나의 연관을 <emphasis>현재</emphasis> 인스턴스 "
-"(null <literal>effectiveEndDate</literal>을 가진 인스턴스)로 매핑시킬 수 있"
-"다:"
+#, no-c-format
+msgid "You can then map an association to the <emphasis>current</emphasis> instance, the one with null <literal>effectiveEndDate</literal>, by using:"
+msgstr "그때 당신은 다음을 사용하여 하나의 연관을 널이 허용되는 <literal>effectiveEndDate</literal>를 가진, <emphasis>current</emphasis> 인스턴스에 매핑시킬 수 있다:"
#. Tag: programlisting
#: association_mapping.xml:296
@@ -843,23 +1044,18 @@
" <formula>'1'</formula>\n"
"</many-to-one>]]>"
msgstr ""
+"<![CDATA[<many-to-one name=\"currentAccountInfo\" \n"
+" property-ref=\"currentAccountKey\"\n"
+" class=\"AccountInfo\">\n"
+" <column name=\"accountNumber\"/>\n"
+" <formula>'1'</formula>\n"
+"</many-to-one>]]>"
#. Tag: para
#: association_mapping.xml:298
-#, fuzzy, no-c-format
-msgid ""
-"In a more complex example, imagine that the association between "
-"<literal>Employee</literal> and <literal>Organization</literal> is "
-"maintained in an <literal>Employment</literal> table full of historical "
-"employment data. An association to the employee's <emphasis>most recent</"
-"emphasis> employer, the one with the most recent <literal>startDate</"
-"literal>, could be mapped in the following way:"
-msgstr ""
-"보다 복잡한 예제에서, <literal>Employee</literal>와 <literal>Organization</"
-"literal> 사이의 연관이 전체 고용 내역 데이터를 가진 <literal>Employment</"
-"literal> 테이블 내에 유지된다고 가정하자. 그때 종업원의 <emphasis>가장 최근의"
-"</emphasis> 고용주에 대한 하나의 연관(가장 최근의 <literal>startDate</"
-"literal>를 갖고 있는 것)이 다음 방법으로 매핑될 수 있다:"
+#, no-c-format
+msgid "In a more complex example, imagine that the association between <literal>Employee</literal> and <literal>Organization</literal> is maintained in an <literal>Employment</literal> table full of historical employment data. An association to the employee's <emphasis>most recent</emphasis> employer, the one with the most recent <literal>startDate</literal>, could be mapped in the following way:"
+msgstr "보다 복잡한 예제에서, <literal>Employee</literal>와 <literal>Organization</literal> 사이의 연관이 전체 고용 내역 데이터를 가진 <literal>Employment</literal> 테이블 내에 유지된다고 가정하자. 종업원의 <emphasis>가장 최근의</emphasis> 고용주에 대한 연관, 가장 최근의 <literal>startDate</literal>를 가진 연관이 다음 방법으로 매핑될 수 있다:"
#. Tag: programlisting
#: association_mapping.xml:306
@@ -878,13 +1074,22 @@
" column=\"orgId\"/>\n"
"</join>]]>"
msgstr ""
+"<![CDATA[<join>\n"
+" <key column=\"employeeId\"/>\n"
+" <subselect>\n"
+" select employeeId, orgId \n"
+" from Employments \n"
+" group by orgId \n"
+" having startDate = max(startDate)\n"
+" </subselect>\n"
+" <many-to-one name=\"mostRecentEmployer\" \n"
+" class=\"Organization\" \n"
+" column=\"orgId\"/>\n"
+"</join>]]>"
#. Tag: para
#: association_mapping.xml:308
-#, fuzzy, no-c-format
-msgid ""
-"This functionality allows a degree of creativity and flexibility, but it is "
-"more practical to handle these kinds of cases using HQL or a criteria query."
-msgstr ""
-"당신은 이 기능으로 아주 생산성을 얻을 수 있지만, 그것은 대개 HQL 또는 "
-"criteria 질의를 사용하여 이들 종류의 경우들을 처리하는 것이 보다 실용적이다."
+#, no-c-format
+msgid "This functionality allows a degree of creativity and flexibility, but it is more practical to handle these kinds of cases using HQL or a criteria query."
+msgstr "이 기능은 생산성과 유연성 제고를 허용하지만, HQL이나 criteria 질의를 사용하여 이들 종류의 경우들을 처리하는 것이 보다 실용적이다."
+
14 years, 3 months
Hibernate SVN: r18512 - core/trunk/documentation/manual/src/main/docbook/ko-KR/content.
by hibernate-commits@lists.jboss.org
Author: jdkim528
Date: 2010-01-12 06:36:49 -0500 (Tue, 12 Jan 2010)
New Revision: 18512
Modified:
core/trunk/documentation/manual/src/main/docbook/ko-KR/content/architecture.po
Log:
translated!
Modified: core/trunk/documentation/manual/src/main/docbook/ko-KR/content/architecture.po
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/ko-KR/content/architecture.po 2010-01-12 08:15:15 UTC (rev 18511)
+++ core/trunk/documentation/manual/src/main/docbook/ko-KR/content/architecture.po 2010-01-12 11:36:49 UTC (rev 18512)
@@ -3,8 +3,8 @@
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-07-14 19:55+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2010-01-12 20:35+0900\n"
+"Last-Translator: Jongdae Kim <jdkim528(a)korea.com>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -24,68 +24,39 @@
#. Tag: para
#: architecture.xml:35
-#, fuzzy, no-c-format
-msgid ""
-"The diagram below provides a high-level view of the Hibernate architecture:"
-msgstr "Hibernate 아키텍처에 대한 (매우) 높은 수준의 개요::"
+#, no-c-format
+msgid "The diagram below provides a high-level view of the Hibernate architecture:"
+msgstr "아래 다이어그램은 Hibernate 아키텍처에 대한 높은 수준의 뷰를 제공한다:"
#. Tag: para
#: architecture.xml:48
-#, fuzzy, no-c-format
-msgid ""
-"We do not have the scope in this document to provide a more detailed view of "
-"all the runtime architectures available; Hibernate is flexible and supports "
-"several different approaches. We will, however, show the two extremes: "
-"\"minimal\" architecture and \"comprehensive\" architecture."
-msgstr ""
-"우리는 런타임 아키텍처에 대한 보다 상세한 뷰를 보여주고 싶다. 불행하게도, "
-"Hibernate는 유연하며 몇 가지 접근법들을 제공한다. 우리는 두 가지 극단을 보여"
-"줄 것이다. \"경량급\" 아키텍처는 그것 자신의 JDBC 커넥션들을 제공하고 그것 자"
-"신의 트랜잭션들을 관리하는 어플리케이션을 갖는다. 이 접근법은 Hibernate의 API"
-"의 최소 부분집합을 사용한다:"
+#, no-c-format
+msgid "We do not have the scope in this document to provide a more detailed view of all the runtime architectures available; Hibernate is flexible and supports several different approaches. We will, however, show the two extremes: \"minimal\" architecture and \"comprehensive\" architecture."
+msgstr "우리가 이용 가능한 모든 런타임 아키텍처들에 대한 보다 상세한 개요를 제공하는 것은 이 문서의 범위를 넘어선다; Hibernate는 유연하며 몇몇 다른 접근법들을 제공한다. 하지만 우리는 두 가지 극단을 보여줄 것이다. \"최소\" 아키텍처와 \"종합\" 아키텍처."
#. Tag: para
#: architecture.xml:54
-#, fuzzy, no-c-format
-msgid ""
-"This next diagram illustrates how Hibernate utilizes database and "
-"configuration data to provide persistence services, and persistent objects, "
-"to the application."
-msgstr ""
-"이 다이어그램은 어플리케이션에 영속화 서비스들(과 영속 객체들)을 제공하기 위"
-"해 데이터베이스와 컨피그레이션을 사용하는 Hibernate를 보여준다."
+#, no-c-format
+msgid "This next diagram illustrates how Hibernate utilizes database and configuration data to provide persistence services, and persistent objects, to the application."
+msgstr "이 다음 다이어그램은 하이버네이트가 영속화 서비스들과 영속 객체들을 어플리케이션에 제공하기 위해 데이터베이스와 컨피그레이션 데이터를 어떻게 이용하는지를 설명한다."
#. Tag: para
#: architecture.xml:59
-#, fuzzy, no-c-format
-msgid ""
-"The \"minimal\" architecture has the application provide its own JDBC "
-"connections and manage its own transactions. This approach uses a minimal "
-"subset of Hibernate's APIs:"
-msgstr ""
-"우리는 런타임 아키텍처에 대한 보다 상세한 뷰를 보여주고 싶다. 불행하게도, "
-"Hibernate는 유연하며 몇 가지 접근법들을 제공한다. 우리는 두 가지 극단을 보여"
-"줄 것이다. \"경량급\" 아키텍처는 그것 자신의 JDBC 커넥션들을 제공하고 그것 자"
-"신의 트랜잭션들을 관리하는 어플리케이션을 갖는다. 이 접근법은 Hibernate의 API"
-"의 최소 부분집합을 사용한다:"
+#, no-c-format
+msgid "The \"minimal\" architecture has the application provide its own JDBC connections and manage its own transactions. This approach uses a minimal subset of Hibernate's APIs:"
+msgstr "\"최소\" 아키텍처는 어플리케이션으로 하여금 그것 자신의 JDBC 커넥션들을 가지고 그것 자신의 트랜잭션들을 관리하도록 한다. 이 접근법은 하이버네이트 API의 최소 부분집합을 사용한다:"
#. Tag: para
#: architecture.xml:74
-#, fuzzy, no-c-format
-msgid ""
-"The \"comprehensive\" architecture abstracts the application away from the "
-"underlying JDBC/JTA APIs and allows Hibernate to manage the details."
-msgstr ""
-"\"전체 정수\" 아키텍처는 기본 JDBC/JTA로부터 어플리케이션을 추상화 시키고 "
-"Hibernate로 하여금 상세한 것을 처리하게 한다."
+#, no-c-format
+msgid "The \"comprehensive\" architecture abstracts the application away from the underlying JDBC/JTA APIs and allows Hibernate to manage the details."
+msgstr "\"종합\" 아키텍처는 기본 JDBC/JTA로부터 어플리케이션을 추상화 시키고 Hibernate로 하여금 세부적인 것을 관리하도록 한다."
#. Tag: para
#: architecture.xml:88
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Here are some definitions of the objects depicted in the diagrams:"
-msgstr ""
-"다음은 다이어그램들 내에 있는 객체들에 대한 몇가지 정의들이다: <placeholder-"
-"1/>"
+msgstr "다음은 다이어그램에 도해되어 있는 객체들에 대한 몇가지 정의들이다:"
#. Tag: term
#: architecture.xml:93
@@ -95,18 +66,9 @@
#. Tag: para
#: architecture.xml:95
-#, fuzzy, no-c-format
-msgid ""
-"A threadsafe, immutable cache of compiled mappings for a single database. A "
-"factory for <literal>Session</literal> and a client of "
-"<literal>ConnectionProvider</literal>, <literal>SessionFactory</literal> can "
-"hold an optional (second-level) cache of data that is reusable between "
-"transactions at a process, or cluster, level."
-msgstr ""
-"단일 데이터베이스에 대한 컴파일된 매핑들의 threadsafe (불변의) 캐시. Session"
-"과 ConnectionProvider의 클라이언트를 위한 팩토리. 프로세스 레벨 또는 클러스"
-"터 레벨에서 트랜잭션들 사이에 재사용 가능한 데이터의 선택적인 (second-level) "
-"캐시를 보관할 수도 있다."
+#, no-c-format
+msgid "A threadsafe, immutable cache of compiled mappings for a single database. A factory for <literal>Session</literal> and a client of <literal>ConnectionProvider</literal>, <literal>SessionFactory</literal> can hold an optional (second-level) cache of data that is reusable between transactions at a process, or cluster, level."
+msgstr "단일 데이터베이스에 대해 컴파일된 매핑들에 관한 쓰레드안전한, 불변 캐시. <literal>Session</literal>을 위한 팩토리와 <literal>ConnectionProvider</literal>, <literal>SessionFactory</literal>의 클라이언트는 프로세스 레벨 또는 클러스터 레벨에서 트랜잭션들 사이에 재사용이 가능한 데이터에 대한 선택적인 (second-level) 캐시를 보유할 수 있다."
#. Tag: term
#: architecture.xml:105
@@ -116,18 +78,9 @@
#. Tag: para
#: architecture.xml:107
-#, fuzzy, no-c-format
-msgid ""
-"A single-threaded, short-lived object representing a conversation between "
-"the application and the persistent store. It wraps a JDBC connection and is "
-"a factory for <literal>Transaction</literal>. <literal>Session</literal> "
-"holds a mandatory first-level cache of persistent objects that are used when "
-"navigating the object graph or looking up objects by identifier."
-msgstr ""
-"어플리케이션과 영속 저장소 사이의 대화를 표현하는 단일 쓰레드이고, 수명이 짧"
-"은 객체. JDBC 커넥션을 포장한다. <literal>Transaction</literal> 용 팩토리. 객"
-"체 그래프를 네비게이트 하거나 식별자로 객체들을 룩업할 때 사용되는 영속 객체"
-"들에 대한 필수적인(첫 번째 레벨의) 캐시를 보관한다."
+#, no-c-format
+msgid "A single-threaded, short-lived object representing a conversation between the application and the persistent store. It wraps a JDBC connection and is a factory for <literal>Transaction</literal>. <literal>Session</literal> holds a mandatory first-level cache of persistent objects that are used when navigating the object graph or looking up objects by identifier."
+msgstr "어플리케이션과 영속 저장소 사이의 대화를 표현하는 단일 쓰레드이면서 수명이 짧은 객체. 그것은 JDBC 커넥션을 포장하며, <literal>Transaction</literal>을 위한 팩토리이다. <literal>Session</literal>은 객체 그래프를 네비게이트 하거나 식별자로서 객체들을 탐색할 때 사용되는 영속 객체들에 대한 필수적인 첫 번째 레벨 캐시를 보유하고 있다."
#. Tag: term
#: architecture.xml:117
@@ -137,22 +90,9 @@
#. Tag: para
#: architecture.xml:119
-#, fuzzy, no-c-format
-msgid ""
-"Short-lived, single threaded objects containing persistent state and "
-"business function. These can be ordinary JavaBeans/POJOs. They are "
-"associated with exactly one <literal>Session</literal>. Once the "
-"<literal>Session</literal> is closed, they will be detached and free to use "
-"in any application layer (for example, directly as data transfer objects to "
-"and from presentation)."
-msgstr ""
-"persistent 상태와 비지니스 기능을 포함하는 수명이 짧고, 단일 쓰레드인 객체"
-"들. 이것들은 통상의 JavaBeans/POJO들일 수 있고, 오직 그것들에 대한 오직 특별"
-"한 것은 그것들이 현재 (정확하게 한 개의) <literal>Session</literal>과 연관되"
-"어 있다는 점이다. <literal>Session</literal>이 닫히자마자, 그것들은 분리될"
-"(detached 상태가 될) 것이고 어플리케이션 레이어에서 사용하는 것이 자유로와진"
-"다(예를 들면. 직접적으로 프리젠테이션 계층으로 데이터 전송 객체들로서 그리고 "
-"직접적으로 프리젠테이션 계층으로부터 데이터 전송 객체들로서)."
+#, no-c-format
+msgid "Short-lived, single threaded objects containing persistent state and business function. These can be ordinary JavaBeans/POJOs. They are associated with exactly one <literal>Session</literal>. Once the <literal>Session</literal> is closed, they will be detached and free to use in any application layer (for example, directly as data transfer objects to and from presentation)."
+msgstr "영속 상태와 비지니스 기능을 포함하는 수명이 짧은, 단일 쓰레드 객체들. 이것들은 통상의 자바빈즈/POJO들일 수 있다. 그것들은 정확히 한 개의 <literal>Session</literal>과 연관지워진다. <literal>Session</literal>이 닫히는 순간, 그것들은 분리될 것이고 임의의 어플리케이션 계층에서 사용이 자유로워진다(예를 들면. 직접적으로 프리젠테이션 계층 사이의 데이터 전송 객체들로서)."
#. Tag: term
#: architecture.xml:129
@@ -162,16 +102,9 @@
#. Tag: para
#: architecture.xml:131
-#, fuzzy, no-c-format
-msgid ""
-"Instances of persistent classes that are not currently associated with a "
-"<literal>Session</literal>. They may have been instantiated by the "
-"application and not yet persisted, or they may have been instantiated by a "
-"closed <literal>Session</literal>."
-msgstr ""
-"<literal>Session</literal>과 현재 연관되어 있지 않은 영속 클래스들의 인스턴스"
-"들. 그것들은 어플리케이션에 의해 초기화 되었고 (아직) 영속화 되지 않았거나 그"
-"것들은 닫혀진<literal>Session</literal>에 의해 초기화 되었을 수도 있다."
+#, no-c-format
+msgid "Instances of persistent classes that are not currently associated with a <literal>Session</literal>. They may have been instantiated by the application and not yet persisted, or they may have been instantiated by a closed <literal>Session</literal>."
+msgstr "현재 <literal>Session</literal>과 연관되어 있지 않은 영속 클래스들의 인스턴스들. 그것들은 어플리케이션에 의해 초기화 되었고 아직 영속화 되지 않았거나 그것들은 닫힌 <literal>Session</literal>에 의해 초기화 되었을 수 있다."
#. Tag: term
#: architecture.xml:140
@@ -181,64 +114,33 @@
#. Tag: para
#: architecture.xml:142
-#, fuzzy, no-c-format
-msgid ""
-"(Optional) A single-threaded, short-lived object used by the application to "
-"specify atomic units of work. It abstracts the application from the "
-"underlying JDBC, JTA or CORBA transaction. A <literal>Session</literal> "
-"might span several <literal>Transaction</literal>s in some cases. However, "
-"transaction demarcation, either using the underlying API or "
-"<literal>Transaction</literal>, is never optional."
-msgstr ""
-"(옵션) 작업의 원자 단위를 지정하기 위해 어플리케이션에 의해 사용되는 단일 쓰"
-"레드이고, 수명이 짧은 객체. 기본 JDBC, JTA 또는 CORBA 트랜잭션으로부터 어플리"
-"케이션을 추상화 시킨다. 몇몇 경우들에서 하나의 <literal>Session</literal>은 "
-"여러 개의 <literal>Transaction</literal>들에 걸칠 수 있다. 하지만 기본 API 또"
-"는 <literal>Transaction</literal>을 사용하는 트랜잭션 경계 설정은 결코 옵션"
-"이 아니다!"
+#, no-c-format
+msgid "(Optional) A single-threaded, short-lived object used by the application to specify atomic units of work. It abstracts the application from the underlying JDBC, JTA or CORBA transaction. A <literal>Session</literal> might span several <literal>Transaction</literal>s in some cases. However, transaction demarcation, either using the underlying API or <literal>Transaction</literal>, is never optional."
+msgstr "(옵션) 어플리케이션에 의해 작업의 원자 단위를 지정하는데 사용되는 단일 쓰레드인, 수명이 짧은 객체. 그것은 기본 JDBC, JTA 또는 CORBA 트랜잭션으로부터 어플리케이션을 추상화 시킨다. 몇몇 경우들에서 하나의 <literal>Session</literal>은 여러 개의 <literal>Transaction</literal>들에 걸쳐져 있을 수 있다. 하지만 기본 API 또는 <literal>Transaction</literal> 중 어느것을 사용하는 트랜잭션 경계 설정은 결코 옵션이 아니다."
#. Tag: term
#: architecture.xml:153
#, no-c-format
-msgid ""
-"ConnectionProvider (<literal>org.hibernate.connection.ConnectionProvider</"
-"literal>)"
-msgstr ""
-"ConnectionProvider (<literal>org.hibernate.connection.ConnectionProvider</"
-"literal>)"
+msgid "ConnectionProvider (<literal>org.hibernate.connection.ConnectionProvider</literal>)"
+msgstr "ConnectionProvider (<literal>org.hibernate.connection.ConnectionProvider</literal>)"
#. Tag: para
#: architecture.xml:155
-#, fuzzy, no-c-format
-msgid ""
-"(Optional) A factory for, and pool of, JDBC connections. It abstracts the "
-"application from underlying <literal>Datasource</literal> or "
-"<literal>DriverManager</literal>. It is not exposed to application, but it "
-"can be extended and/or implemented by the developer."
-msgstr ""
-"(옵션) JDBC 커넥션들에 대한 팩토리(그리고 그것들의 pool). 기본 "
-"<literal>Datasource</literal> 또는 <literal>DriverManager</literal>로부터 어"
-"플리케이션을 추상화 시킨다. 어플리케이션에 노출되지는 않지만 개발자에 의해 확"
-"장/구현 된다."
+#, no-c-format
+msgid "(Optional) A factory for, and pool of, JDBC connections. It abstracts the application from underlying <literal>Datasource</literal> or <literal>DriverManager</literal>. It is not exposed to application, but it can be extended and/or implemented by the developer."
+msgstr "(옵션) JDBC 연결들을 위한 팩토리, 그리고 그것들의 pool. 그것은 기본 <literal>Datasource</literal> 또는 <literal>DriverManager</literal>로부터 어플리케이션을 추상화 시킨다. 그것은 어플리케이션에 노출되지 않지만, 그것은 개발자에 의해 확장 그리고/또는 구현 될 수 있다."
#. Tag: term
#: architecture.xml:163
#, no-c-format
-msgid ""
-"TransactionFactory (<literal>org.hibernate.TransactionFactory</literal>)"
-msgstr ""
-"TransactionFactory (<literal>org.hibernate.TransactionFactory</literal>)"
+msgid "TransactionFactory (<literal>org.hibernate.TransactionFactory</literal>)"
+msgstr "TransactionFactory (<literal>org.hibernate.TransactionFactory</literal>)"
#. Tag: para
#: architecture.xml:165
-#, fuzzy, no-c-format
-msgid ""
-"(Optional) A factory for <literal>Transaction</literal> instances. It is not "
-"exposed to the application, but it can be extended and/or implemented by the "
-"developer."
-msgstr ""
-"(옵션) <literal>Transaction</literal> 인스턴스들에 대한 팩토리. 어플리케이션"
-"에 노출되지는 않지만 개발자에 의해 확장/구현 된다."
+#, no-c-format
+msgid "(Optional) A factory for <literal>Transaction</literal> instances. It is not exposed to the application, but it can be extended and/or implemented by the developer."
+msgstr "(옵션) <literal>Transaction</literal> 인스턴스들을 위한 팩토리. 그것은 어플리케이션에 노출되지 않지만, 그것은 개발자에 의해 확장 그리고/또는 구현 될 수 있다."
#. Tag: emphasis
#: architecture.xml:172
@@ -248,27 +150,15 @@
#. Tag: para
#: architecture.xml:174
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate offers a range of optional extension interfaces you can implement "
-"to customize the behavior of your persistence layer. See the API "
-"documentation for details."
-msgstr ""
-"Hibernate는 당신의 영속 계층의 특성을 맞춤화 시키기 위해 당신이 구현할 수 있"
-"는 선택적인 확장 인터페이스들을 제공한다. 상세한 것은 API 문서를 보라."
+#, no-c-format
+msgid "Hibernate offers a range of optional extension interfaces you can implement to customize the behavior of your persistence layer. See the API documentation for details."
+msgstr "하이버네이트는 당신이 당신의 영속 계층의 행위를 맞춤화 시키기 위해 구현할 수 있는 선택적인 확장 인터페이스들의 영역을 제공한다. 상세한 것은 API 문서를 보라."
#. Tag: para
#: architecture.xml:183
-#, fuzzy, no-c-format
-msgid ""
-"Given a \"minimal\" architecture, the application bypasses the "
-"<literal>Transaction</literal>/<literal>TransactionFactory</literal> and/or "
-"<literal>ConnectionProvider</literal> APIs to communicate with JTA or JDBC "
-"directly."
-msgstr ""
-"주어진 \"경량급\" 아키텍처의 경우, 어플리케이션은 JTA 또는 JDBC와 직접 대화하"
-"기 위해서 <literal>Transaction</literal>/<literal>TransactionFactory</"
-"literal> 그리고/또는 <literal>ConnectionProvider</literal> API들을 무시한다."
+#, no-c-format
+msgid "Given a \"minimal\" architecture, the application bypasses the <literal>Transaction</literal>/<literal>TransactionFactory</literal> and/or <literal>ConnectionProvider</literal> APIs to communicate with JTA or JDBC directly."
+msgstr "\"최소\" 아키텍처의 경우, 어플리케이션은 JTA 또는 JDBC와 직접 통신하기 위해 <literal>Transaction</literal>/<literal>TransactionFactory</literal> 그리고/또는 <literal>ConnectionProvider</literal> API들을 무시한다."
#. Tag: title
#: architecture.xml:191
@@ -278,16 +168,9 @@
#. Tag: para
#: architecture.xml:192
-#, fuzzy, no-c-format
-msgid ""
-"An instance of a persistent class can be in one of three different states. "
-"These states are defined in relation to a <emphasis>persistence context</"
-"emphasis>. The Hibernate <literal>Session</literal> object is the "
-"persistence context. The three different states are as follows:"
-msgstr ""
-"영속 클래스들의 인스턴스는 세개의 상태들 중 하나 일 수 있다. 그것들(상태들)"
-"은 영속 컨텍스트(<emphasis>persistence context</emphasis>)에 대해 정의된다. "
-"Hibernate <literal>Session</literal> 객체는 영속 컨텍스트이다:"
+#, no-c-format
+msgid "An instance of a persistent class can be in one of three different states. These states are defined in relation to a <emphasis>persistence context</emphasis>. The Hibernate <literal>Session</literal> object is the persistence context. The three different states are as follows:"
+msgstr "영속 클래스들의 인스턴스는 세개의 상태들 중 하나에 놓여질 수 있다. 이들 상태들은 <emphasis>영속 컨텍스트</emphasis>에 관련하여 정의된다. 하이버네이트 <literal>Session</literal> 객체는 영속 컨텍스트이다. 세 개의 다른 상태들은 다음과 같다:"
#. Tag: term
#: architecture.xml:200
@@ -297,13 +180,9 @@
#. Tag: para
#: architecture.xml:202
-#, fuzzy, no-c-format
-msgid ""
-"The instance is not associated with any persistence context. It has no "
-"persistent identity or primary key value."
-msgstr ""
-"인스턴스는 임의의 컨텍스트와 연관되어 있지 않고, 결코 연관된 적이 없었다. 그"
-"것은 영속 식별자(프라이머리 키 값)을 갖지 않는다."
+#, no-c-format
+msgid "The instance is not associated with any persistence context. It has no persistent identity or primary key value."
+msgstr "그 인스턴스는 임의의 영속 컨텍스트와 연관지워져 있지 않다. 그것은 영속 식별자 또는 프라이머리 키 값을 갖지 않는다."
#. Tag: term
#: architecture.xml:210
@@ -313,18 +192,9 @@
#. Tag: para
#: architecture.xml:212
-#, fuzzy, no-c-format
-msgid ""
-"The instance is currently associated with a persistence context. It has a "
-"persistent identity (primary key value) and can have a corresponding row in "
-"the database. For a particular persistence context, Hibernate "
-"<emphasis>guarantees</emphasis> that persistent identity is equivalent to "
-"Java identity in relation to the in-memory location of the object."
-msgstr ""
-"인스턴스는 현재 영속 컨텍스트와 연관되어 있다. 그것은 영속 식별자(프라이머리 "
-"키 값) 그리고 아마 데이터베이스 내에 있는 대응하는 행을 갖는다. 특별한 영속 "
-"컨텍스트의 경우, Hibernate는 영속 identity가 Java identity(객체의 메모리 내 "
-"위치)와 같다는 점을 <emphasis>보증한다</emphasis>."
+#, no-c-format
+msgid "The instance is currently associated with a persistence context. It has a persistent identity (primary key value) and can have a corresponding row in the database. For a particular persistence context, Hibernate <emphasis>guarantees</emphasis> that persistent identity is equivalent to Java identity in relation to the in-memory location of the object."
+msgstr "그 인스턴스는 현재 영속 컨텍스트와 연관되어 있다. 그것은 영속 식별자(프라이머리 키 값)을 갖고 있고 데이터베이스 내에서 하나의 대응하는 행을 가질 수 있다. 특정 영속 컨텍스트의 경우, 하이버네이트는 영속 식별자가 객체의 메모리 내 위치에 관하여 자바 식별자와 동등함을 <emphasis>보증한다</emphasis>."
#. Tag: term
#: architecture.xml:224
@@ -334,18 +204,9 @@
#. Tag: para
#: architecture.xml:226
-#, fuzzy, no-c-format
-msgid ""
-"The instance was once associated with a persistence context, but that "
-"context was closed, or the instance was serialized to another process. It "
-"has a persistent identity and can have a corresponding row in the database. "
-"For detached instances, Hibernate does not guarantee the relationship "
-"between persistent identity and Java identity."
-msgstr ""
-"인스턴스는 영속 컨텍스트와 한번 연관되었지만, 그 컨텍스트가 닫혔거나, 그 인스"
-"턴스가 또 다른 프로세스로 직렬화 되었다. 그것은 영속 identity 그리고, 아마 데"
-"이터베이스 내에 대응하는 행을 갖는다. detached 인스턴스들의 경우, Hibernate"
-"는 영속 identity과 Java identity 사이의 관계를 보증하지 않는다."
+#, no-c-format
+msgid "The instance was once associated with a persistence context, but that context was closed, or the instance was serialized to another process. It has a persistent identity and can have a corresponding row in the database. For detached instances, Hibernate does not guarantee the relationship between persistent identity and Java identity."
+msgstr "그 인스턴스는 일단 영속 컨텍스트와 연관되었지만, 그 컨텍스트가 닫혀졌거나, 또는 그 인스턴스가 또 다른 프로세스에 직렬화 되었다. 그것은 영속 식별자를 갖고 있으며, 데이터베이스 내에서 하나의 대응하는 행을 가질 수 있다. 분리된 인스턴스들의 경우, 하이버네이트는 영속 식별자와 자바 식별자 사이의 관계를 보증하지 않는다."
#. Tag: title
#: architecture.xml:241
@@ -355,90 +216,39 @@
#. Tag: para
#: architecture.xml:243
-#, fuzzy, no-c-format
-msgid ""
-"JMX is the J2EE standard for the management of Java components. Hibernate "
-"can be managed via a JMX standard service. AN MBean implementation is "
-"provided in the distribution: <literal>org.hibernate.jmx.HibernateService</"
-"literal>."
-msgstr ""
-"JMX는 자바 컴포넌트 관리를 위한 J2EE 표준이다. Hibernate는 JMX 표준 서비스를 "
-"통해 관리될 수도 있다. 우리는 배포본 내에 MBean 구현, <literal>org.hibernate."
-"jmx.HibernateService</literal>를 제공한다."
+#, no-c-format
+msgid "JMX is the J2EE standard for the management of Java components. Hibernate can be managed via a JMX standard service. AN MBean implementation is provided in the distribution: <literal>org.hibernate.jmx.HibernateService</literal>."
+msgstr "JMX는 자바 컴포넌트 관리를 위한 J2EE 표준이다. 하이버네이트는 JMX 표준 서비스를 통해 관리될 수 있다. 하나의 MBean 구현이 배포본 내에 제공된다: <literal>org.hibernate.jmx.HibernateService</literal>."
#. Tag: para
#: architecture.xml:249
-#, fuzzy, no-c-format
-msgid ""
-"For an example of how to deploy Hibernate as a JMX service on the JBoss "
-"Application Server, please see the JBoss User Guide. JBoss AS also provides "
-"these benefits if you deploy using JMX:"
-msgstr ""
-"JBoss 어플리케이션 서버 상에 Hibernae를 JMX 서비스로서 배치하는 방법에 대한 "
-"예제는 JBoss 사용자 가이드를 보길 바란다. JBoss 어플리케이션 서버 상에서, 만"
-"일 당신이 JMX를 사용하여 배치할 경우 당신은 또한 다음 이점들을 얻는다:"
+#, no-c-format
+msgid "For an example of how to deploy Hibernate as a JMX service on the JBoss Application Server, please see the JBoss User Guide. JBoss AS also provides these benefits if you deploy using JMX:"
+msgstr "JBoss 어플리케이션 서버 상에 JMX 서비스로서 하이버네이트를 배포하는 방법에 대한 예제는 JBoss 사용자 가이드를 보길 바란다. 당신이 JMX를 사용하여 배포할 경우, JBoss AS는 또한 다음 이점들을 제공한다: "
#. Tag: para
#: architecture.xml:257
-#, fuzzy, no-c-format
-msgid ""
-"<emphasis>Session Management</emphasis>: the Hibernate <literal>Session</"
-"literal>'s life cycle can be automatically bound to the scope of a JTA "
-"transaction. This means that you no longer have to manually open and close "
-"the <literal>Session</literal>; this becomes the job of a JBoss EJB "
-"interceptor. You also do not have to worry about transaction demarcation in "
-"your code (if you would like to write a portable persistence layer use the "
-"optional Hibernate <literal>Transaction</literal> API for this). You call "
-"the <literal>HibernateContext</literal> to access a <literal>Session</"
-"literal>."
-msgstr ""
-"<emphasis>Session 관리:</emphasis> Hibernate <literal>Session</literal>의 생"
-"명주기가 JTA 트랜잭션의 영역 내에 자동적으로 바인드 될 수 있다. 이것은 당신"
-"이 더이상 <literal>Session</literal>을 수작업으로 열고 닫지 않아도 됨을 의미"
-"하고, 이것은 JBoss EJB 인터셉터의 업무가 된다. 당신은 또한 더 이상 당신의 코"
-"드 어느 곳에서든 트랜잭션 경계설정에 대해 걱정하지 않아도 된다(당신이 물론 이"
-"식성 있는 영속 계층을 작성하고자 원하지 않는한, 이를 위해 옵션 Hibernate "
-"<literal>Transaction</literal> API를 사용하라). 당신은 <literal>Session</"
-"literal>에 접근하기 위해 <literal>HibernateContext</literal>를 호출한다."
+#, no-c-format
+msgid "<emphasis>Session Management</emphasis>: the Hibernate <literal>Session</literal>'s life cycle can be automatically bound to the scope of a JTA transaction. This means that you no longer have to manually open and close the <literal>Session</literal>; this becomes the job of a JBoss EJB interceptor. You also do not have to worry about transaction demarcation in your code (if you would like to write a portable persistence layer use the optional Hibernate <literal>Transaction</literal> API for this). You call the <literal>HibernateContext</literal> to access a <literal>Session</literal>."
+msgstr "<emphasis>세션 관리</emphasis>: 하이버네이트 <literal>Session</literal>의 생명주기는 JTA 트랜잭션의 영역에 자동적으로 묶여질 수 있다. 이것은 당신이 <literal>Session</literal>을 더 이상 수작업으로 열거나 닫지 않아도 됨을 의미한다; 이것은 JBoss 인터셉터의 작업이 된다. 당신은 또한 더 이상 당신의 코드 내에서 트랜잭션 격리에 대해 걱정하지 않아도 된다(만일 당신이 이식가능한 영속 계층을 작성하고자 원할 경우 이것을 위해 선택적으로 하이버네이트 <literal>Transaction</literal> API를 사용하라). 당신은 <literal>Session</literal>에 접근하기 위해 <literal>HibernateContext</literal>를 호출한다."
#. Tag: para
#: architecture.xml:269
-#, fuzzy, no-c-format
-msgid ""
-"<emphasis>HAR deployment</emphasis>: the Hibernate JMX service is deployed "
-"using a JBoss service deployment descriptor in an EAR and/or SAR file, as it "
-"supports all the usual configuration options of a Hibernate "
-"<literal>SessionFactory</literal>. However, you still need to name all your "
-"mapping files in the deployment descriptor. If you use the optional HAR "
-"deployment, JBoss will automatically detect all mapping files in your HAR "
-"file."
-msgstr ""
-"<emphasis>HAR 배치:</emphasis> 대개 당신은 JBoss 서비스 배치 디스크립터를 사"
-"용하여 Hibernate JMX 서비스를 (EAR 과/또는 SAR 파일로) 배치하고, 그것은 "
-"Hibernate <literal>SessionFactory</literal>의 통상적인 구성 옵션들 모두를 지"
-"원한다. 하지만 당신은 여전히 모든 당신의 매핑 파일들을 배치 디스크립터 속에 "
-"명명해야 한다. 만일 당신이 옵션 HAR 배치를 사용하고자 결정하는 경우, JBoss는 "
-"당신의 HAR 파일 내에 있는 모든 매핑 파일들을 자동적으로 검출해낼 것이다."
+#, no-c-format
+msgid "<emphasis>HAR deployment</emphasis>: the Hibernate JMX service is deployed using a JBoss service deployment descriptor in an EAR and/or SAR file, as it supports all the usual configuration options of a Hibernate <literal>SessionFactory</literal>. However, you still need to name all your mapping files in the deployment descriptor. If you use the optional HAR deployment, JBoss will automatically detect all mapping files in your HAR file."
+msgstr "<emphasis>HAR 배포</emphasis>: JBoss가 하이버네이트 <literal>SessionFactory</literal>의 거의 모든 구성 옵션들을 지원하므로, 하이버네이트 JMS 서비스는 JBoss 서비스 배포 디스크립터를 사용하여 EAR 그리고/또는 SAR 파일로서 배포된다. 하지만 당신은 여전히 배포 디스크립터 내에 모든 당신의 매핑 파일들을 명명할 필요가 있다. 만일 당신이 선택적인 HAR 배포를 사용할 경우, JBoss는 당신의 HAR 파일 내에 있는 모든 매핑 파일들을 자동적으로 검출할 것이다."
#. Tag: para
#: architecture.xml:280
#, no-c-format
-msgid ""
-"Consult the JBoss AS user guide for more information about these options."
-msgstr ""
-"이들 옵션들에 대한 추가 정보는 JBoss 어플리케이션 서버 사용자 가이드를 참조하"
-"라."
+msgid "Consult the JBoss AS user guide for more information about these options."
+msgstr "이들 옵션들에 대한 추가 정보는 JBoss 어플리케이션 서버 사용자 가이드를 참조하라."
#. Tag: para
#: architecture.xml:284
-#, fuzzy, no-c-format
-msgid ""
-"Another feature available as a JMX service is runtime Hibernate statistics. "
-"See <xref linkend=\"configuration-optional-statistics\"/> for more "
-"information."
-msgstr ""
-"JMX 서비스로서 이용 가능한 또다른 특징은 런타임 Hibernate 통계이다. <xref "
-"linkend=\"configuration-optional-statistics\"/>를 보라."
+#, no-c-format
+msgid "Another feature available as a JMX service is runtime Hibernate statistics. See <xref linkend=\"configuration-optional-statistics\"/> for more information."
+msgstr "JMX 서비스로서 이용 가능한 또다른 특징은 런타임 하이버네이트 통계이다. 부가 정보는 <xref linkend=\"configuration-optional-statistics\"/>를 보라."
#. Tag: title
#: architecture.xml:291
@@ -448,193 +258,67 @@
#. Tag: para
#: architecture.xml:292
-#, fuzzy, no-c-format
-msgid ""
-"Hibernate can also be configured as a JCA connector. Please see the website "
-"for more information. Please note, however, that at this stage Hibernate JCA "
-"support is under development."
-msgstr ""
-"Hibernate는 JCA 커넥터로서 구성될 수도 있다. 상세한 것은 웹 사이트를 보길 바"
-"란다. Hibernate JCA 지원은 여전히 실험적으로 검토 중에 있음을 노트하길 바란"
-"다."
+#, no-c-format
+msgid "Hibernate can also be configured as a JCA connector. Please see the website for more information. Please note, however, that at this stage Hibernate JCA support is under development."
+msgstr "하이버네이트는 또한 JCA 커넥터로서 구성될 수도 있다. 부가 정보는 웹 사이트를 보길 바란다. 하지만 현 단게에서 하이버네이트 JCA 지원은 개발 중에 있음을 염두에 두길 바란다."
#. Tag: title
#: architecture.xml:299
-#, fuzzy, no-c-format
+#, no-c-format
msgid "Contextual sessions"
-msgstr "컨텍스트 상의 세션들"
+msgstr "컨텍스트의 세션들"
#. Tag: para
#: architecture.xml:300
-#, fuzzy, no-c-format
-msgid ""
-"Most applications using Hibernate need some form of \"contextual\" session, "
-"where a given session is in effect throughout the scope of a given context. "
-"However, across applications the definition of what constitutes a context is "
-"typically different; different contexts define different scopes to the "
-"notion of current. Applications using Hibernate prior to version 3.0 tended "
-"to utilize either home-grown <literal>ThreadLocal</literal>-based contextual "
-"sessions, helper classes such as <literal>HibernateUtil</literal>, or "
-"utilized third-party frameworks, such as Spring or Pico, which provided "
-"proxy/interception-based contextual sessions."
-msgstr ""
-"Hibernate를 사용하는 대부분의 어플리케이션들은 어떤 양식의 \"컨텍스트상의"
-"(contextual)\" 세션들을 필요로 한다. 여기서 주어진 세션은 주어진 컨텍스트의 "
-"영역에 걸쳐 활동을 한다. 하지만 어플리케이션들을 가로질러 컨텍스트를 구성하"
-"는 것에 대한 정의는 일반적으로 다르다; 그리고 다른 컨텍스트들은 현재라고 하"
-"는 개념에 대해 다른 영역들을 정의한다. 버전 3.0 전의 Hibernate를 사용하는 어"
-"플리케이션들은 자가생산된 <literal>ThreadLocal</literal>-기반의 컨텍스상의 세"
-"션들, <literal>HibernateUtil</literal>과 같은 helper 클래스들을 활용했거나 프"
-"락시/인터셉션 기반의 컨텍스트상의 세션들을 제공해주었던 (Spring 또는 Pico와 "
-"같은 )제 3의 프레임웍들을 활용하는 경향이 있었다."
+#, no-c-format
+msgid "Most applications using Hibernate need some form of \"contextual\" session, where a given session is in effect throughout the scope of a given context. However, across applications the definition of what constitutes a context is typically different; different contexts define different scopes to the notion of current. Applications using Hibernate prior to version 3.0 tended to utilize either home-grown <literal>ThreadLocal</literal>-based contextual sessions, helper classes such as <literal>HibernateUtil</literal>, or utilized third-party frameworks, such as Spring or Pico, which provided proxy/interception-based contextual sessions."
+msgstr "하이버네이트를 사용하는 대부분의 어플리케이션들은 \"컨텍스트상의(contextual)\" 세션에 대한 어떤 형식을 필요로 하며, 여기서 주어진 세션은 주어진 컨텍스트의 영역 내에서 효과가 있다. 하지만 어플리케이션들을 가로질러 어던 컨텍스트를 구성하는 것에 대한 정의는 일반적으로 다르다; 그리고 다른 컨텍스트들이 현재라고 하는 개념에 대해 다른 영역들을 정의한다. 버전 3.0 이전의 하이버네이트를 사용하는 어플리케이션들은 <literal>HibernateUtil</literal>과 같은 helper 클래스들인, 자가생산된 <literal>ThreadLocal</literal>-기반의 컨텍스트 세션들을 활용하려고 했거나, 프락시/인터셉션 기반의 컨텍스트 세션들을 제공해주었던, Spring이나 Pico와 같은 제 3의 프레임웍들을 활용했다."
#. Tag: para
#: architecture.xml:309
-#, fuzzy, no-c-format
-msgid ""
-"Starting with version 3.0.1, Hibernate added the <literal>SessionFactory."
-"getCurrentSession()</literal> method. Initially, this assumed usage of "
-"<literal>JTA</literal> transactions, where the <literal>JTA</literal> "
-"transaction defined both the scope and context of a current session. Given "
-"the maturity of the numerous stand-alone <literal>JTA TransactionManager</"
-"literal> implementations, most, if not all, applications should be using "
-"<literal>JTA</literal> transaction management, whether or not they are "
-"deployed into a <literal>J2EE</literal> container. Based on that, the "
-"<literal>JTA</literal>-based contextual sessions are all you need to use."
-msgstr ""
-"버전 3.0.1에서부터 시작하여, Hibernate는 <literal>SessionFactory."
-"getCurrentSession()</literal> 메소드를 추가했다. 초기에 이것은 <literal>JTA</"
-"literal> 트랜잭션들을 사용하는 것을 전제했다. 여기서 <literal>JTA</literal> "
-"트랜잭션은 현재 세션의 영역과 컨텍스트를 정의했다. Hibernate 팀은 성숙된 다수"
-"의 스탠드얼론 <literal>JTA TransactionManager</literal> 구현들이 발표되면, "
-"(전부는 아니겠지만) 대부분의 어플리케이션들이 그것들이 <literal>J2EE</"
-"literal> 컨테이너 내로 배치되든 그렇지 않든 간에 <literal>JTA</literal> 트랜"
-"잭션 관리를 사용하게 될 것이라고 주장한다. 그것에 기초하여, <literal>JTA</"
-"literal>에 기반한 컨텍스트상의 세션들은 언젠가 당신이 사용을 필요로 하게 될 "
-"전부다."
+#, no-c-format
+msgid "Starting with version 3.0.1, Hibernate added the <literal>SessionFactory.getCurrentSession()</literal> method. Initially, this assumed usage of <literal>JTA</literal> transactions, where the <literal>JTA</literal> transaction defined both the scope and context of a current session. Given the maturity of the numerous stand-alone <literal>JTA TransactionManager</literal> implementations, most, if not all, applications should be using <literal>JTA</literal> transaction management, whether or not they are deployed into a <literal>J2EE</literal> container. Based on that, the <literal>JTA</literal>-based contextual sessions are all you need to use."
+msgstr "버전 3.0.1에서부터, 하이버네이트는 <literal>SessionFactory.getCurrentSession()</literal> 메소드를 추가했다. 초기에 이것은 <literal>JTA</literal> 트랜잭션 사용을 전제했으며, <literal>JTA</literal> 트랜잭션은 현 세션의 영역 및 컨텍스트 둘 다 정의했다. 많은 스탠드얼론 <literal>JTA TransactionManager</literal> 구현들이 성숙되면, 전부는 아니겠지만, 대부분의 어플리케이션들이 <literal>J2EE</literal> 컨테이너 내로 배포되든 그렇지 않든 간에 대부분의 어플리케이션들이 <literal>JTA</literal> 트랜잭션 관리를 사용하게 될 것이다. 그것에 기초하면, <literal>JTA</literal>에 기반한 컨텍스트 세션들은 당신이 사용할 필요가 있는 모든 것이다."
#. Tag: para
#: architecture.xml:319
-#, fuzzy, no-c-format
-msgid ""
-"However, as of version 3.1, the processing behind <literal>SessionFactory."
-"getCurrentSession()</literal> is now pluggable. To that end, a new extension "
-"interface, <literal>org.hibernate.context.CurrentSessionContext</literal>, "
-"and a new configuration parameter, <literal>hibernate."
-"current_session_context_class</literal>, have been added to allow "
-"pluggability of the scope and context of defining current sessions."
-msgstr ""
-"하지만 버전 3.1 이후로 <literal>SessionFactory.getCurrentSession()</literal> "
-"이면의 처리과정은 이제 플러그 가능하다. 그것을 끝내기 위해, 하나의 새로운 확"
-"장 인터페이스 (<literal>org.hibernate.context.CurrentSessionContext</"
-"literal>)와 하나의 새로운 구성 파라미터(<literal>hibernate."
-"current_session_context_class</literal>)가 현재 세션들을 정의하는 영역과 컨텍"
-"스트의 플러그 가능성을 허용하기 위해 추가되었다."
+#, no-c-format
+msgid "However, as of version 3.1, the processing behind <literal>SessionFactory.getCurrentSession()</literal> is now pluggable. To that end, a new extension interface, <literal>org.hibernate.context.CurrentSessionContext</literal>, and a new configuration parameter, <literal>hibernate.current_session_context_class</literal>, have been added to allow pluggability of the scope and context of defining current sessions."
+msgstr "하지만 현재 버전 3.1에서 <literal>SessionFactory.getCurrentSession()</literal> 이면의 처리과정이 이제 플러그 가능하다. 그것으로 인해, 하나의 새로운 확장 인터페이스, <literal>org.hibernate.context.CurrentSessionContext</literal>)와 하나의 새로운 구성 파라미터, <literal>hibernate.current_session_context_class</literal>가 현재 세션들을 정의하는 영역 및 컨텍스트의 플러그 가능성을 허용하도록 추가되었다."
#. Tag: para
#: architecture.xml:326
-#, fuzzy, no-c-format
-msgid ""
-"See the Javadocs for the <literal>org.hibernate.context."
-"CurrentSessionContext</literal> interface for a detailed discussion of its "
-"contract. It defines a single method, <literal>currentSession()</literal>, "
-"by which the implementation is responsible for tracking the current "
-"contextual session. Out-of-the-box, Hibernate comes with three "
-"implementations of this interface:"
-msgstr ""
-"그것의 계약에 대한 상세한 논의는 <literal>org.hibernate.context."
-"CurrentSessionContext</literal> 인터페이스에 관한 javadocs를 보라. 그것은 하"
-"나의 메소드, <literal>currentSession()</literal>를 정의하며, 그 구현은 현재"
-"의 컨텍스트 상의 세션을 추적할 책임이 있다. 비공식적으로, Hibernate는 이 인터"
-"페이스에 대한 세 개의 구현들을 부수적으로 포함하고 있다."
+#, no-c-format
+msgid "See the Javadocs for the <literal>org.hibernate.context.CurrentSessionContext</literal> interface for a detailed discussion of its contract. It defines a single method, <literal>currentSession()</literal>, by which the implementation is responsible for tracking the current contextual session. Out-of-the-box, Hibernate comes with three implementations of this interface:"
+msgstr "그것의 계약에 대한 상세한 논의는 <literal>org.hibernate.context.CurrentSessionContext</literal> 인터페이스에 관한 javadocs를 보라. 그것은 하나의 메소드, <literal>currentSession()</literal>를 정의하며, 그 구현은 현재의 컨텍스트 상의 세션을 추적할 책임이 있다. 비공식적으로, Hibernate는 이 인터페이스에 대한 세 개의 구현들을 부수적으로 포함하고 있다."
#. Tag: para
#: architecture.xml:336
-#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.context.JTASessionContext</literal>: current sessions "
-"are tracked and scoped by a <literal>JTA</literal> transaction. The "
-"processing here is exactly the same as in the older JTA-only approach. See "
-"the Javadocs for details."
-msgstr ""
-"<literal>org.hibernate.context.JTASessionContext</literal> - 현재의 세션들은 "
-"하나의 <literal>JTA</literal>에 의해 추적되고 영역화 된다. 여기서 처리과정은 "
-"이전의 JTA-전용 접근과 정확하게 동일하다. 상세한 것은 javadocs를 보라."
+#, no-c-format
+msgid "<literal>org.hibernate.context.JTASessionContext</literal>: current sessions are tracked and scoped by a <literal>JTA</literal> transaction. The processing here is exactly the same as in the older JTA-only approach. See the Javadocs for details."
+msgstr "<literal>org.hibernate.context.JTASessionContext</literal>: 현재 세션들은 <literal>JTA</literal> 트랜잭션에 의해 추적되고 영역화 된다. 여기서 처리는 예전의 JTA-전용 접근법과 정확하게 같다. 상세한 것은 Javadocs를 보라."
#. Tag: para
#: architecture.xml:344
-#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.context.ThreadLocalSessionContext</literal>:current "
-"sessions are tracked by thread of execution. See the Javadocs for details."
-msgstr ""
-"<literal>org.hibernate.context.ThreadLocalSessionContext</literal> - 현재의 "
-"세션들은 실행 쓰레드에 의해 추적된다. 상세한 것은 다시 javadocs를 보라."
+#, no-c-format
+msgid "<literal>org.hibernate.context.ThreadLocalSessionContext</literal>:current sessions are tracked by thread of execution. See the Javadocs for details."
+msgstr "<literal>org.hibernate.context.ThreadLocalSessionContext</literal> :현재 세션들은 실행 쓰레드에 의해 추적된다. 상세한 것은 다시 javadocs를 보라."
#. Tag: para
#: architecture.xml:350
-#, fuzzy, no-c-format
-msgid ""
-"<literal>org.hibernate.context.ManagedSessionContext</literal>: current "
-"sessions are tracked by thread of execution. However, you are responsible to "
-"bind and unbind a <literal>Session</literal> instance with static methods on "
-"this class: it does not open, flush, or close a <literal>Session</literal>."
-msgstr ""
-"NOT TRANSLATED! <literal>org.hibernate.context.ManagedSessionContext</"
-"literal> - current sessions are tracked by thread of execution. However, you "
-"are responsible to bind and unbind a <literal>Session</literal> instance "
-"with static methods on this class, it does never open, flush, or close a "
-"<literal>Session</literal>."
+#, no-c-format
+msgid "<literal>org.hibernate.context.ManagedSessionContext</literal>: current sessions are tracked by thread of execution. However, you are responsible to bind and unbind a <literal>Session</literal> instance with static methods on this class: it does not open, flush, or close a <literal>Session</literal>."
+msgstr "<literal>org.hibernate.context.ManagedSessionContext</literal> : 현재 세션들은 실행 쓰레드에 의해 추적된다. 하지만 <literal>Session</literal> 인스턴스를 이 클래스 상에 있는 static 메소드들에 바인딩시키고 언바인딩 시킬 책임이 당신에게 있다: 그것은 <literal>Session</literal>을 열지도 flush 시키거나 닫지 않는다."
#. Tag: para
#: architecture.xml:359
-#, fuzzy, no-c-format
-msgid ""
-"The first two implementations provide a \"one session - one database "
-"transaction\" programming model. This is also also known and used as "
-"<emphasis>session-per-request</emphasis>. The beginning and end of a "
-"Hibernate session is defined by the duration of a database transaction. If "
-"you use programmatic transaction demarcation in plain JSE without JTA, you "
-"are advised to use the Hibernate <literal>Transaction</literal> API to hide "
-"the underlying transaction system from your code. If you use JTA, you can "
-"utilize the JTA interfaces to demarcate transactions. If you execute in an "
-"EJB container that supports CMT, transaction boundaries are defined "
-"declaratively and you do not need any transaction or session demarcation "
-"operations in your code. Refer to <xref linkend=\"transactions\"/> for more "
-"information and code examples."
-msgstr ""
-"처음의 두 구현들은 <emphasis>session-per-request</emphasis>로 알려지고 사용되"
-"고 있는 \"하나의 세션 - 하나의 데이터베이스 트랜잭션\" 프로그래밍 모형을 제공"
-"한다. 하나의 Hibernate 세션의 시작과 끝은 데이터베이스 트랜잭션의 존속 기간"
-"에 의해 정의된다. 만일 (예를 들면 순수 J2SE에서 또는 JTA/UserTransaction/BMT"
-"의 경우에) 당신이 프로그램 상의 트랜잭션 경계구분을 사용할 경우, 당신은 당신"
-"의 코드로부터 기본 트랜잭션 시스템을 은폐시키는데 Hibernate "
-"<literal>Transaction</literal> API를 사용하는 것이 권장된다. 만일 당신이 CMT"
-"를 지원하는 하나의 EJB 컨테이너에서 실행할 경우, 트랜잭션 경계들이 선언적으"
-"로 정의되고 당신은 당신의 코드 내에 어떤 트랜잭션도 세션 경계구분 오퍼레이션"
-"들을 필요로 하지 않는다. 추가 정보와 코드 예제들은 <xref linkend="
-"\"transactions\"/>를 참조하라."
+#, no-c-format
+msgid "The first two implementations provide a \"one session - one database transaction\" programming model. This is also also known and used as <emphasis>session-per-request</emphasis>. The beginning and end of a Hibernate session is defined by the duration of a database transaction. If you use programmatic transaction demarcation in plain JSE without JTA, you are advised to use the Hibernate <literal>Transaction</literal> API to hide the underlying transaction system from your code. If you use JTA, you can utilize the JTA interfaces to demarcate transactions. If you execute in an EJB container that supports CMT, transaction boundaries are defined declaratively and you do not need any transaction or session demarcation operations in your code. Refer to <xref linkend=\"transactions\"/> for more information and code examples."
+msgstr "첫 두 개의 구현들은 \"한 개의 세션 - 한 개의 데이터베이스 트랜잭션\" 프로그래밍 모형을 제공한다. 이것은 또한 <emphasis>요청 당 세션</emphasis>으로 알려져 있고 사용된다. 하이버네이트 세션의 시작과 끝은 데이터베이스 트랜잭션의 존속 기간에 의해 정의된다. 만일 당신이 JTA없이 평범한 JSE에서 프로그램 상의 트랜잭션 격리를 사용할 경우, 당신에게 당신의 코드에서 기본 트랜잭션 시스템을 은폐시키는데 하이버네이트 <literal>Transaction</literal> API를 사용하도록 권장된다.만일 당신이 CMT를 지원하는 EJB 컨테이너 내에서 실행할 경우, 트랜잭션 경계들은 선언적으로 정의되며 당신이 당신의 코드에 임의의 트랜잭션 또는 세션 경계설정 오퍼레이션을 필요로 하지 않는다. 만일 당신이 CMT를 지원하는 하나의 EJB 컨테이너에서 실행할 경우!
, 트랜잭션 경계들이 선언적으로 정의되고 당신은 당신의 코드 내에서 어떠한 트랜잭션이나 세션 경계구분 오퍼레이션들을 필요로 하지 않는다. 부가 정보와 코드 예제들은 <xref linkend=\"transactions\"/>를 참조하라."
#. Tag: para
#: architecture.xml:371
-#, fuzzy, no-c-format
-msgid ""
-"The <literal>hibernate.current_session_context_class</literal> configuration "
-"parameter defines which <literal>org.hibernate.context."
-"CurrentSessionContext</literal> implementation should be used. For backwards "
-"compatibility, if this configuration parameter is not set but a <literal>org."
-"hibernate.transaction.TransactionManagerLookup</literal> is configured, "
-"Hibernate will use the <literal>org.hibernate.context.JTASessionContext</"
-"literal>. Typically, the value of this parameter would just name the "
-"implementation class to use. For the three out-of-the-box implementations, "
-"however, there are three corresponding short names: \"jta\", \"thread\", and "
-"\"managed\"."
-msgstr ""
-"<literal>hibernate.current_session_context_class</literal> 구성 파라미터는 "
-"<literal>org.hibernate.context.CurrentSessionContext</literal> 구현이 사용될 "
-"것임을 정의한다. 역호환을 위해. 만일 이 구성 파라미터가 설정되지 않았지만 하"
-"나의 <literal>org.hibernate.transaction.TransactionManagerLookup</literal>이 "
-"구성되어 있을 경우, Hibernate는 <literal>org.hibernate.context."
-"JTASessionContext</literal>를 사용할 것임을 노트하라. 일반적으로, 이 파라미터"
-"의 값은 단지 사용할 구현 클래스를 명명할 것이다; 하지만 두 가지 비공식적인 구"
-"현들로서 두 개의 대응하는 짧은 이름들 \"jta\"와 \"thread\"이 존재한다."
+#, no-c-format
+msgid "The <literal>hibernate.current_session_context_class</literal> configuration parameter defines which <literal>org.hibernate.context.CurrentSessionContext</literal> implementation should be used. For backwards compatibility, if this configuration parameter is not set but a <literal>org.hibernate.transaction.TransactionManagerLookup</literal> is configured, Hibernate will use the <literal>org.hibernate.context.JTASessionContext</literal>. Typically, the value of this parameter would just name the implementation class to use. For the three out-of-the-box implementations, however, there are three corresponding short names: \"jta\", \"thread\", and \"managed\"."
+msgstr "<literal>hibernate.current_session_context_class</literal> 구성 파라미터는 어느 <literal>org.hibernate.context.CurrentSessionContext</literal> 구현이 사용될 것인지를 정의한다. 역호환을 위해. 만일 이 구성 파라미터가 설정되지 않지만 하나의 <literal>org.hibernate.transaction.TransactionManagerLookup</literal>이 구성되는 경우에, 하이버네이트는 <literal>org.hibernate.context.JTASessionContext</literal>를 사용할 것이다. 일반적으로, 이 파라미터의 값은 단지 사용할 구현 클래스를 명명할 것이다; 하지만 세 개의 비공식적인 구현들에 대해, 세 개의 대응하는 짧은 이름들 \"jta\"와 \"thread\", 그리고 \"managed\"가 존재한다."
+
14 years, 3 months
Hibernate SVN: r18511 - core/trunk/testsuite/src/test/java/org/hibernate/test/readonly.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2010-01-12 03:15:15 -0500 (Tue, 12 Jan 2010)
New Revision: 18511
Modified:
core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java
Log:
HHH-4781 : Added unit test showing a read-only entity that is refreshed is changed to modifiable
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java 2010-01-12 01:16:55 UTC (rev 18510)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/readonly/ReadOnlyTest.java 2010-01-12 08:15:15 UTC (rev 18511)
@@ -141,6 +141,43 @@
}
+ public void testReadOnlyRefreshFailureExpected() {
+
+ Session s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ Transaction t = s.beginTransaction();
+ DataPoint dp = new DataPoint();
+ dp.setDescription( "original" );
+ dp.setX( new BigDecimal(0.1d).setScale(19, BigDecimal.ROUND_DOWN) );
+ dp.setY( new BigDecimal( Math.cos( dp.getX().doubleValue() ) ).setScale(19, BigDecimal.ROUND_DOWN) );
+ s.save(dp);
+ t.commit();
+ s.close();
+
+ s = openSession();
+ s.setCacheMode(CacheMode.IGNORE);
+ t = s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dp.getId() );
+ s.setReadOnly( dp, true );
+ assertEquals( "original", dp.getDescription() );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ s.refresh( dp );
+ assertEquals( "original", dp.getDescription() );
+ dp.setDescription( "changed" );
+ assertEquals( "changed", dp.getDescription() );
+ t.commit();
+
+ s.clear();
+ t = s.beginTransaction();
+ dp = ( DataPoint ) s.get( DataPoint.class, dp.getId() );
+ assertEquals( "original", dp.getDescription() );
+ s.delete( dp );
+ t.commit();
+ s.close();
+
+ }
+
public void testReadOnlyOnTextType() {
final String origText = "some huge text string";
final String newText = "some even bigger text string";
14 years, 3 months
Hibernate SVN: r18510 - core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded.
by hibernate-commits@lists.jboss.org
Author: smarlow(a)redhat.com
Date: 2010-01-11 20:16:55 -0500 (Mon, 11 Jan 2010)
New Revision: 18510
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/FavoriteThings.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/InternetFavorites.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/URLFavorite.java
Modified:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java
Log:
HHH-4598 An embeddable class may contains collection of basic types or embeddable objects
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java 2010-01-11 23:46:47 UTC (rev 18509)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/EmbeddedTest.java 2010-01-12 01:16:55 UTC (rev 18510)
@@ -2,6 +2,9 @@
package org.hibernate.test.annotations.embedded;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -415,6 +418,68 @@
s.close();
}
+ // make sure we support collection of embeddable objects inside embeddable objects
+ public void testEmbeddableInsideEmbeddable() throws Exception {
+ Session s;
+ Transaction tx;
+
+ Collection<URLFavorite> urls = new ArrayList<URLFavorite>();
+ URLFavorite urlFavorite = new URLFavorite();
+ urlFavorite.setUrl( "http://highscalability.com/" );
+ urls.add(urlFavorite);
+
+ urlFavorite = new URLFavorite();
+ urlFavorite.setUrl( "http://www.jboss.org/" );
+ urls.add(urlFavorite);
+
+ urlFavorite = new URLFavorite();
+ urlFavorite.setUrl( "http://www.hibernate.org/" );
+ urls.add(urlFavorite);
+
+ urlFavorite = new URLFavorite();
+ urlFavorite.setUrl( "http://www.jgroups.org/" );
+ urls.add( urlFavorite );
+
+ Collection<String>ideas = new ArrayList<String>();
+ ideas.add( "lionheart" );
+ ideas.add( "xforms" );
+ ideas.add( "dynamic content" );
+ ideas.add( "http" );
+
+ InternetFavorites internetFavorites = new InternetFavorites();
+ internetFavorites.setLinks( urls );
+ internetFavorites.setIdeas( ideas );
+
+ FavoriteThings favoriteThings = new FavoriteThings();
+ favoriteThings.setWeb( internetFavorites );
+
+ s = openSession();
+
+ tx = s.beginTransaction();
+ s.persist(favoriteThings);
+ tx.commit();
+
+ tx = s.beginTransaction();
+ s.flush();
+ favoriteThings = (FavoriteThings) s.get( FavoriteThings.class, favoriteThings.getId() );
+ assertTrue( "has web", favoriteThings.getWeb() != null );
+ assertTrue( "has ideas", favoriteThings.getWeb().getIdeas() != null );
+ assertTrue( "has favorite idea 'http'",favoriteThings.getWeb().getIdeas().contains("http") );
+ assertTrue( "has favorite idea 'http'",favoriteThings.getWeb().getIdeas().contains("dynamic content") );
+
+ urls = favoriteThings.getWeb().getLinks();
+ assertTrue( "has urls", urls != null);
+ URLFavorite[] favs = new URLFavorite[4];
+ urls.toArray(favs);
+ assertTrue( "has http://www.hibernate.org url favorite link",
+ "http://www.hibernate.org/".equals( favs[0].getUrl() ) ||
+ "http://www.hibernate.org/".equals( favs[1].getUrl() ) ||
+ "http://www.hibernate.org/".equals( favs[2].getUrl() ) ||
+ "http://www.hibernate.org/".equals( favs[3].getUrl() ));
+ tx.commit();
+ s.close();
+ }
+
public EmbeddedTest(String x) {
super( x );
}
@@ -431,7 +496,8 @@
InternetProvider.class,
CorpType.class,
Nationality.class,
- Manager.class
+ Manager.class,
+ FavoriteThings.class
};
}
}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/FavoriteThings.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/FavoriteThings.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/FavoriteThings.java 2010-01-12 01:16:55 UTC (rev 18510)
@@ -0,0 +1,34 @@
+package org.hibernate.test.annotations.embedded;
+
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+/**
+ * Has collection of embeddable objects inside embeddable objects for testing HHH-4598
+ */
+
+@Entity
+public class FavoriteThings {
+ @Id
+ int id;
+
+ @Embedded
+ InternetFavorites web;
+
+ public InternetFavorites getWeb() {
+ return web;
+ }
+
+ public void setWeb(InternetFavorites web) {
+ this.web = web;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/InternetFavorites.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/InternetFavorites.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/InternetFavorites.java 2010-01-12 01:16:55 UTC (rev 18510)
@@ -0,0 +1,32 @@
+package org.hibernate.test.annotations.embedded;
+
+import javax.persistence.Embeddable;
+import javax.persistence.Embedded;
+import java.util.Collection;
+
+@Embeddable
+public class InternetFavorites {
+
+ @Embedded
+ Collection<URLFavorite> links;
+
+ @Embedded
+ Collection<String> ideas;
+
+ public Collection<String> getIdeas() {
+ return ideas;
+ }
+
+ public void setIdeas(Collection<String> ideas) {
+ this.ideas = ideas;
+ }
+
+ public Collection<URLFavorite> getLinks() {
+
+ return links;
+ }
+
+ public void setLinks(Collection<URLFavorite> links) {
+ this.links = links;
+ }
+}
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/URLFavorite.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/URLFavorite.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/embedded/URLFavorite.java 2010-01-12 01:16:55 UTC (rev 18510)
@@ -0,0 +1,17 @@
+package org.hibernate.test.annotations.embedded;
+
+import javax.persistence.Embeddable;
+
+@Embeddable
+public class URLFavorite {
+
+ private String url;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+}
14 years, 3 months
Hibernate SVN: r18509 - core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-11 18:46:47 -0500 (Mon, 11 Jan 2010)
New Revision: 18509
Modified:
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java
Log:
HHH-4590 - CASTs from CriteriaBuilder.toXXX methods still need to be fleshed out
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java 2010-01-11 22:55:36 UTC (rev 18508)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java 2010-01-11 23:46:47 UTC (rev 18509)
@@ -220,7 +220,7 @@
@Override
public String render(BigInteger value) {
- return "cast( " + value.toString() + " as BigInteger )";
+ return value.toString() + "BI";
}
}
@@ -244,7 +244,7 @@
@Override
public String render(BigDecimal value) {
- return "cast( " + value.toString() + " as BigDecimal )";
+ return value.toString() + "BD";
}
}
14 years, 3 months
Hibernate SVN: r18508 - in core/trunk: core/src/main/java/org/hibernate/hql/ast and 4 other directories.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2010-01-11 17:55:36 -0500 (Mon, 11 Jan 2010)
New Revision: 18508
Modified:
core/trunk/core/src/main/antlr/hql-sql.g
core/trunk/core/src/main/antlr/hql.g
core/trunk/core/src/main/antlr/sql-gen.g
core/trunk/core/src/main/java/org/hibernate/hql/ast/SqlASTFactory.java
core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/LiteralNode.java
core/trunk/core/src/main/java/org/hibernate/hql/ast/util/LiteralProcessor.java
core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java
core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
Log:
HHH-4780 - Allow BigDecimal and BigInteger to be specified as numeric literal types
Modified: core/trunk/core/src/main/antlr/hql-sql.g
===================================================================
--- core/trunk/core/src/main/antlr/hql-sql.g 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/antlr/hql-sql.g 2010-01-11 22:55:36 UTC (rev 18508)
@@ -598,6 +598,8 @@
| NUM_LONG { processNumericLiteral( #literal ); }
| NUM_FLOAT { processNumericLiteral( #literal ); }
| NUM_DOUBLE { processNumericLiteral( #literal ); }
+ | NUM_BIG_INTEGER { processNumericLiteral( #literal ); }
+ | NUM_BIG_DECIMAL { processNumericLiteral( #literal ); }
| QUOTED_STRING
;
Modified: core/trunk/core/src/main/antlr/hql.g
===================================================================
--- core/trunk/core/src/main/antlr/hql.g 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/antlr/hql.g 2010-01-11 22:55:36 UTC (rev 18508)
@@ -133,6 +133,8 @@
NUM_DOUBLE;
NUM_FLOAT;
NUM_LONG;
+ NUM_BIG_INTEGER;
+ NUM_BIG_DECIMAL;
JAVA_CONSTANT;
}
@@ -693,6 +695,8 @@
| NUM_FLOAT
| NUM_LONG
| NUM_DOUBLE
+ | NUM_BIG_INTEGER
+ | NUM_BIG_DECIMAL
| QUOTED_STRING
| NULL
| TRUE
@@ -821,12 +825,13 @@
: '.' {_ttype = DOT;}
( ('0'..'9')+ (EXPONENT)? (f1:FLOAT_SUFFIX {t=f1;})?
{
- if (t != null && t.getText().toUpperCase().indexOf('F')>=0)
- {
+ if ( t != null && t.getText().toUpperCase().indexOf("BD")>=0) {
+ _ttype = NUM_BIG_DECIMAL;
+ }
+ else if (t != null && t.getText().toUpperCase().indexOf('F')>=0) {
_ttype = NUM_FLOAT;
}
- else
- {
+ else {
_ttype = NUM_DOUBLE; // assume double
}
}
@@ -847,6 +852,7 @@
| ('1'..'9') ('0'..'9')* {isDecimal=true;} // non-zero decimal
)
( ('l') { _ttype = NUM_LONG; }
+ | ('b''i') { _ttype = NUM_BIG_INTEGER; }
// only check to see if it's a float if looks like decimal so far
| {isDecimal}?
@@ -855,12 +861,13 @@
| f4:FLOAT_SUFFIX {t=f4;}
)
{
- if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0)
- {
+ if ( t != null && t.getText().toUpperCase().indexOf("BD")>=0) {
+ _ttype = NUM_BIG_DECIMAL;
+ }
+ else if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0) {
_ttype = NUM_FLOAT;
}
- else
- {
+ else {
_ttype = NUM_DOUBLE; // assume double
}
}
@@ -881,6 +888,6 @@
protected
FLOAT_SUFFIX
- : 'f'|'d'
+ : 'f'|'d'|'b''d'
;
Modified: core/trunk/core/src/main/antlr/sql-gen.g
===================================================================
--- core/trunk/core/src/main/antlr/sql-gen.g 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/antlr/sql-gen.g 2010-01-11 22:55:36 UTC (rev 18508)
@@ -353,6 +353,8 @@
| NUM_FLOAT
| NUM_INT
| NUM_LONG
+ | NUM_BIG_INTEGER
+ | NUM_BIG_DECIMAL
| QUOTED_STRING
| CONSTANT
| JAVA_CONSTANT
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/SqlASTFactory.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/SqlASTFactory.java 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/SqlASTFactory.java 2010-01-11 22:55:36 UTC (rev 18508)
@@ -145,6 +145,8 @@
case NUM_FLOAT:
case NUM_LONG:
case NUM_DOUBLE:
+ case NUM_BIG_INTEGER:
+ case NUM_BIG_DECIMAL:
case QUOTED_STRING:
return LiteralNode.class;
case TRUE:
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/LiteralNode.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/LiteralNode.java 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/tree/LiteralNode.java 2010-01-11 22:55:36 UTC (rev 18508)
@@ -22,7 +22,6 @@
* Boston, MA 02110-1301 USA
*
*/
-
package org.hibernate.hql.ast.tree;
import org.hibernate.Hibernate;
@@ -53,6 +52,10 @@
return Hibernate.LONG;
case NUM_DOUBLE:
return Hibernate.DOUBLE;
+ case NUM_BIG_INTEGER:
+ return Hibernate.BIG_INTEGER;
+ case NUM_BIG_DECIMAL:
+ return Hibernate.BIG_DECIMAL;
case QUOTED_STRING:
return Hibernate.STRING;
case TRUE:
Modified: core/trunk/core/src/main/java/org/hibernate/hql/ast/util/LiteralProcessor.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/hql/ast/util/LiteralProcessor.java 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/core/src/main/java/org/hibernate/hql/ast/util/LiteralProcessor.java 2010-01-11 22:55:36 UTC (rev 18508)
@@ -50,6 +50,7 @@
import org.slf4j.LoggerFactory;
import java.math.BigDecimal;
+import java.math.BigInteger;
import java.text.DecimalFormat;
/**
@@ -229,10 +230,14 @@
}
public void processNumeric(AST literal) {
- if ( literal.getType() == NUM_INT || literal.getType() == NUM_LONG ) {
+ if ( literal.getType() == NUM_INT
+ || literal.getType() == NUM_LONG
+ || literal.getType() == NUM_BIG_INTEGER ) {
literal.setText( determineIntegerRepresentation( literal.getText(), literal.getType() ) );
}
- else if ( literal.getType() == NUM_FLOAT || literal.getType() == NUM_DOUBLE ) {
+ else if ( literal.getType() == NUM_FLOAT
+ || literal.getType() == NUM_DOUBLE
+ || literal.getType() == NUM_BIG_DECIMAL ) {
literal.setText( determineDecimalRepresentation( literal.getText(), literal.getType() ) );
}
else {
@@ -250,11 +255,21 @@
log.trace( "could not format incoming text [" + text + "] as a NUM_INT; assuming numeric overflow and attempting as NUM_LONG" );
}
}
- String literalValue = text;
- if ( literalValue.endsWith( "l" ) || literalValue.endsWith( "L" ) ) {
- literalValue = literalValue.substring( 0, literalValue.length() - 1 );
+ else if ( type == NUM_LONG ) {
+ String literalValue = text;
+ if ( literalValue.endsWith( "l" ) || literalValue.endsWith( "L" ) ) {
+ literalValue = literalValue.substring( 0, literalValue.length() - 1 );
+ }
+ return Long.valueOf( literalValue ).toString();
}
- return Long.valueOf( literalValue ).toString();
+ else if ( type == NUM_BIG_INTEGER ) {
+ String literalValue = text;
+ if ( literalValue.endsWith( "bi" ) || literalValue.endsWith( "BI" ) ) {
+ literalValue = literalValue.substring( 0, literalValue.length() - 2 );
+ }
+ return new BigInteger( literalValue ).toString();
+ }
+ throw new HibernateException( "Unknown literal type to parse as integer" );
}
catch( Throwable t ) {
throw new HibernateException( "Could not parse literal [" + text + "] as integer", t );
@@ -273,6 +288,11 @@
literalValue = literalValue.substring( 0, literalValue.length() - 1 );
}
}
+ else if ( type == NUM_BIG_DECIMAL ) {
+ if ( literalValue.endsWith( "bd" ) || literalValue.endsWith( "BD" ) ) {
+ literalValue = literalValue.substring( 0, literalValue.length() - 2 );
+ }
+ }
BigDecimal number = null;
try {
@@ -285,6 +305,7 @@
return formatters[ DECIMAL_LITERAL_FORMAT ].format( number );
}
+
private static interface DecimalFormatter {
String format(BigDecimal number);
}
Modified: core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java
===================================================================
--- core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/entitymanager/src/main/java/org/hibernate/ejb/criteria/ValueHandlerFactory.java 2010-01-11 22:55:36 UTC (rev 18508)
@@ -217,6 +217,11 @@
}
throw unknownConversion( value, BigInteger.class );
}
+
+ @Override
+ public String render(BigInteger value) {
+ return "cast( " + value.toString() + " as BigInteger )";
+ }
}
public static class BigDecimalValueHandler extends BaseValueHandler<BigDecimal> implements Serializable {
@@ -236,6 +241,11 @@
}
throw unknownConversion( value, BigDecimal.class );
}
+
+ @Override
+ public String render(BigDecimal value) {
+ return "cast( " + value.toString() + " as BigDecimal )";
+ }
}
public static class StringValueHandler extends BaseValueHandler<String> implements Serializable {
Modified: core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java
===================================================================
--- core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2010-01-11 20:27:12 UTC (rev 18507)
+++ core/trunk/testsuite/src/test/java/org/hibernate/test/hql/ASTParserLoadingTest.java 2010-01-11 22:55:36 UTC (rev 18508)
@@ -2,6 +2,7 @@
package org.hibernate.test.hql;
import java.math.BigDecimal;
+import java.math.BigInteger;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
@@ -1195,14 +1196,129 @@
a.setBodyWeight(12.4f);
a.setDescription("an animal");
s.persist(a);
- Integer bw = (Integer) s.createQuery("select cast(bodyWeight as integer) from Animal").uniqueResult();
- bw = (Integer) s.createQuery("select cast(a.bodyWeight as integer) from Animal a").uniqueResult();
- bw.toString();
+ Object bodyWeight = s.createQuery("select cast(bodyWeight as integer) from Animal").uniqueResult();
+ assertTrue( Integer.class.isInstance( bodyWeight ) );
+ assertEquals( 12, bodyWeight );
+ bodyWeight = s.createQuery("select cast(bodyWeight as big_decimal) from Animal").uniqueResult();
+ assertTrue( BigDecimal.class.isInstance( bodyWeight ) );
+ assertEquals( BigDecimal.valueOf( a.getBodyWeight() ), bodyWeight );
+ Object literal = s.createQuery("select cast(10000000 as big_integer) from Animal").uniqueResult();
+ assertTrue( BigInteger.class.isInstance( literal ) );
+ assertEquals( BigInteger.valueOf( 10000000 ), literal );
s.delete(a);
t.commit();
s.close();
}
+ /**
+ * Test the numeric expression rules specified in section 4.8.6 of the JPA 2 specification
+ */
+ public void testNumericExpressionReturnTypes() {
+ Session s = openSession();
+ Transaction t = s.beginTransaction();
+ Animal a = new Animal();
+ a.setBodyWeight(12.4f);
+ a.setDescription("an animal");
+ s.persist(a);
+
+ Object result;
+
+ // addition ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ result = s.createQuery( "select 1 + 1 from Animal as a" ).uniqueResult();
+ assertTrue( "int + int", Integer.class.isInstance( result ) );
+ assertEquals( 2, result );
+
+ result = s.createQuery( "select 1 + 1L from Animal a" ).uniqueResult();
+ assertTrue( "int + long", Long.class.isInstance( result ) );
+ assertEquals( Long.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1 + 1BI from Animal a" ).uniqueResult();
+ assertTrue( "int + BigInteger", BigInteger.class.isInstance( result ) );
+ assertEquals( BigInteger.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1 + 1F from Animal a" ).uniqueResult();
+ assertTrue( "int + float", Float.class.isInstance( result ) );
+ assertEquals( Float.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1 + 1D from Animal a" ).uniqueResult();
+ assertTrue( "int + double", Double.class.isInstance( result ) );
+ assertEquals( Double.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1 + 1BD from Animal a" ).uniqueResult();
+ assertTrue( "int + BigDecimal", BigDecimal.class.isInstance( result ) );
+ assertEquals( BigDecimal.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1F + 1D from Animal a" ).uniqueResult();
+ assertTrue( "float + double", Double.class.isInstance( result ) );
+ assertEquals( Double.valueOf( 2 ), result );
+
+ result = s.createQuery( "select 1F + 1BD from Animal a" ).uniqueResult();
+ assertTrue( "float + BigDecimal", Float.class.isInstance( result ) );
+ assertEquals( Float.valueOf( 2 ), result );
+
+ // subtraction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ result = s.createQuery( "select 1 - 1 from Animal as a" ).uniqueResult();
+ assertTrue( "int - int", Integer.class.isInstance( result ) );
+ assertEquals( 0, result );
+
+ result = s.createQuery( "select 1 - 1L from Animal a" ).uniqueResult();
+ assertTrue( "int - long", Long.class.isInstance( result ) );
+ assertEquals( Long.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1 - 1BI from Animal a" ).uniqueResult();
+ assertTrue( "int - BigInteger", BigInteger.class.isInstance( result ) );
+ assertEquals( BigInteger.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1 - 1F from Animal a" ).uniqueResult();
+ assertTrue( "int - float", Float.class.isInstance( result ) );
+ assertEquals( Float.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1 - 1D from Animal a" ).uniqueResult();
+ assertTrue( "int - double", Double.class.isInstance( result ) );
+ assertEquals( Double.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1 - 1BD from Animal a" ).uniqueResult();
+ assertTrue( "int - BigDecimal", BigDecimal.class.isInstance( result ) );
+ assertEquals( BigDecimal.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1F - 1D from Animal a" ).uniqueResult();
+ assertTrue( "float - double", Double.class.isInstance( result ) );
+ assertEquals( Double.valueOf( 0 ), result );
+
+ result = s.createQuery( "select 1F - 1BD from Animal a" ).uniqueResult();
+ assertTrue( "float - BigDecimal", Float.class.isInstance( result ) );
+ assertEquals( Float.valueOf( 0 ), result );
+
+ // multiplication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ result = s.createQuery( "select 1 * 1 from Animal as a" ).uniqueResult();
+ assertTrue( "int * int", Integer.class.isInstance( result ) );
+ assertEquals( 1, result );
+
+ result = s.createQuery( "select 1 * 1L from Animal a" ).uniqueResult();
+ assertTrue( "int * long", Long.class.isInstance( result ) );
+ assertEquals( Long.valueOf( 1 ), result );
+
+ result = s.createQuery( "select 1 * 1BI from Animal a" ).uniqueResult();
+ assertTrue( "int * BigInteger", BigInteger.class.isInstance( result ) );
+ assertEquals( BigInteger.valueOf( 1 ), result );
+
+ result = s.createQuery( "select 1 * 1F from Animal a" ).uniqueResult();
+ assertTrue( "int * float", Float.class.isInstance( result ) );
+ assertEquals( Float.valueOf( 1 ), result );
+
+ result = s.createQuery( "select 1 * 1D from Animal a" ).uniqueResult();
+ assertTrue( "int * double", Double.class.isInstance( result ) );
+ assertEquals( Double.valueOf( 1 ), result );
+
+ result = s.createQuery( "select 1 * 1BD from Animal a" ).uniqueResult();
+ assertTrue( "int * BigDecimal", BigDecimal.class.isInstance( result ) );
+ assertEquals( BigDecimal.valueOf( 1 ), result );
+
+ s.delete(a);
+ t.commit();
+ s.close();
+ }
+
public void testAliases() {
Session s = openSession();
Transaction t = s.beginTransaction();
14 years, 3 months
Hibernate SVN: r18507 - core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-11 15:27:12 -0500 (Mon, 11 Jan 2010)
New Revision: 18507
Added:
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/RentalCar.xml
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist.xml
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist2.xml
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist3.xml
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist4.xml
Log:
HHH-4691 - xml test files for access configuration via xml
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Crew.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <description>Mapping for Crew entity</description>
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <mapped-superclass class="Crew" metadata-complete="false" access="FIELD">
+ <attributes>
+ <id name="id">
+ <generated-value/>
+ </id>
+ </attributes>
+ </mapped-superclass>
+</entity-mappings>
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/RentalCar.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/RentalCar.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/RentalCar.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="RentalCar" metadata-complete="false">
+ <attributes>
+ <one-to-one name="driver" target-entity="Driver" access="PROPERTY"/>
+ </attributes>
+ </entity>
+</entity-mappings>
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd" version="2.0">
+ <description>Mapping for Tourist entity</description>
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="Tourist" cacheable="false" metadata-complete="false">
+ <attributes>
+ <basic name="name" access="PROPERTY"/>
+ <basic name="destination" access="PROPERTY"/>
+ </attributes>
+ </entity>
+</entity-mappings>
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist2.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist2.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist2.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <description>Mapping for Tourist entity</description>
+ <persistence-unit-metadata>
+ <persistence-unit-defaults>
+ <access>PROPERTY</access>
+ </persistence-unit-defaults>
+ </persistence-unit-metadata>
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="Tourist" cacheable="false" metadata-complete="false">
+ <attributes>
+ <id name="id" access="FIELD"/>
+ </attributes>
+ </entity>
+</entity-mappings>
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist3.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist3.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist3.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <description>Mapping for Tourist entity</description>
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <access>PROPERTY</access>
+ <entity class="Tourist" cacheable="false" metadata-complete="false">
+ <attributes>
+ <id name="id" access="FIELD"/>
+ </attributes>
+ </entity>
+</entity-mappings>
Added: core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist4.xml
===================================================================
--- core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist4.xml (rev 0)
+++ core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/Tourist4.xml 2010-01-11 20:27:12 UTC (rev 18507)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm file:/Users/hardy/work/hibernate/core/trunk/annotations/src/main/resources/org/hibernate/ejb/orm_2_0.xsd"
+ version="2.0">
+ <description>Mapping for Tourist entity</description>
+ <package>org.hibernate.test.annotations.access.xml</package>
+ <entity class="Tourist" cacheable="false" metadata-complete="false" access="PROPERTY">
+ <attributes>
+ <id name="id" access="FIELD"/>
+ </attributes>
+ </entity>
+</entity-mappings>
14 years, 3 months
Hibernate SVN: r18506 - in core/trunk/annotations/src: main/java/org/hibernate/cfg/annotations/reflection and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-01-11 15:23:08 -0500 (Mon, 11 Jan 2010)
New Revision: 18506
Added:
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Crew.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Driver.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/RentalCar.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Tourist.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/
core/trunk/annotations/src/test/resources/org/hibernate/test/annotations/access/xml/
Modified:
core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAMetadataProvider.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java
core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java
Log:
HHH-4691 - Added support for access tye configuration via xml
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java 2010-01-11 17:11:03 UTC (rev 18505)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -1,3 +1,4 @@
+// $Id:$
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
@@ -259,7 +260,7 @@
@Override
protected void reset() {
super.reset();
- namedGenerators = new HashMap();
+ namedGenerators = new HashMap<String, IdGenerator>();
joins = new HashMap<String, Map<String, Join>>();
classTypes = new HashMap<String, AnnotatedClassType>();
generatorTables = new HashMap<String, Properties>();
@@ -784,7 +785,7 @@
private static void findClassNames(
String defaultPackage, final Element startNode,
- final java.util.Set names
+ final java.util.Set<String> names
) {
// if we have some extends we need to check if those classes possibly could be inside the
// same hbm.xml file...
Property changes on: core/trunk/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java
___________________________________________________________________
Name: svn:keywords
- Date Revision Author Id
+ Id
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAMetadataProvider.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAMetadataProvider.java 2010-01-11 17:11:03 UTC (rev 18505)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAMetadataProvider.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -61,7 +61,7 @@
}
defaults.put( EntityListeners.class, entityListeners );
for ( Element element : xmlContext.getAllDocuments() ) {
-
+ @SuppressWarnings( "unchecked" )
List<Element> elements = element.elements( "sequence-generator" );
List<SequenceGenerator> sequenceGenerators = ( List<SequenceGenerator> ) defaults.get( SequenceGenerator.class );
if ( sequenceGenerators == null ) {
Property changes on: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAMetadataProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-11 17:11:03 UTC (rev 18505)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverridenAnnotationReader.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -1,3 +1,4 @@
+// $Id:$
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
@@ -36,6 +37,8 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.persistence.Access;
+import javax.persistence.AccessType;
import javax.persistence.AssociationOverride;
import javax.persistence.AssociationOverrides;
import javax.persistence.AttributeOverride;
@@ -107,7 +110,6 @@
import org.dom4j.Attribute;
import org.dom4j.Element;
import org.hibernate.AnnotationException;
-import org.hibernate.annotations.AccessType;
import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.Columns;
import org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor;
@@ -126,12 +128,13 @@
* @author Paolo Perrotta
* @author Davide Marchignoli
* @author Emmanuel Bernard
+ * @author Hardy Ferentschik
*/
@SuppressWarnings("unchecked")
public class JPAOverridenAnnotationReader implements AnnotationReader {
private Logger log = LoggerFactory.getLogger( JPAOverridenAnnotationReader.class );
private static final Map<Class, String> annotationToXml;
- private static final String SCHEMA_VALIDATION = "Activate schema validation for more informations";
+ private static final String SCHEMA_VALIDATION = "Activate schema validation for more information";
private static final Filter FILTER = new Filter() {
public boolean returnStatic() {
return false;
@@ -292,12 +295,16 @@
return annotations;
}
+ /*
+ * The idea is to create annotation proxies for the xml configuration elements. Using this proxy annotations together
+ * with the {@code JPAMetadataprovider} allows to handle xml configuration the same way as annotation configuration.
+ */
private void initAnnotations() {
if ( annotations == null ) {
XMLContext.Default defaults = xmlContext.getDefault( className );
if ( className != null && propertyName == null ) {
//is a class
- Element tree = xmlContext.getXMLTree( className, null );
+ Element tree = xmlContext.getXMLTree( className );
Annotation[] annotations = getJavaAnnotations();
List<Annotation> annotationList = new ArrayList<Annotation>( annotations.length + 5 );
annotationsMap = new HashMap<Class, Annotation>( annotations.length + 5 );
@@ -336,7 +343,7 @@
checkForOrphanProperties( tree );
}
else if ( className != null ) { //&& propertyName != null ) { //always true but less confusing
- Element tree = xmlContext.getXMLTree( className, propertyName );
+ Element tree = xmlContext.getXMLTree( className );
Annotation[] annotations = getJavaAnnotations();
List<Annotation> annotationList = new ArrayList<Annotation>( annotations.length + 5 );
annotationsMap = new HashMap<Class, Annotation>( annotations.length + 5 );
@@ -353,7 +360,7 @@
}
else {
if ( defaults.canUseJavaAnnotations() ) {
- Annotation annotation = getJavaAnnotation( AccessType.class );
+ Annotation annotation = getJavaAnnotation( Access.class );
addIfNotNull( annotationList, annotation );
}
getId( annotationList, defaults );
@@ -425,13 +432,18 @@
}
/**
- * Addes the Annotation to the list (only if it's not null) and then returns it.
+ * Adds {@code annotation} to the list (only if it's not null) and then returns it.
+ *
+ * @param annotationList The list of annotations.
+ * @param annotation The annotation to add to the list.
+ *
+ * @return The annotation which was added to the list or {@code null}.
*/
- private Annotation addIfNotNull(List<Annotation> annotationList, Annotation element) {
- if ( element != null ) {
- annotationList.add( element );
+ private Annotation addIfNotNull(List<Annotation> annotationList, Annotation annotation) {
+ if ( annotation != null ) {
+ annotationList.add( annotation );
}
- return element;
+ return annotation;
}
//TODO mutualize the next 2 methods
@@ -654,14 +666,15 @@
getFetchType( ad, element );
getCascades( ad, element, defaults );
getJoinTable( annotationList, element, defaults );
- buildJoinColumns( annotationList, element, defaults );
+ buildJoinColumns( annotationList, element);
Annotation annotation = getPrimaryKeyJoinColumns( element, defaults );
addIfNotNull( annotationList, annotation );
copyBooleanAttribute( ad, element, "optional" );
copyStringAttribute( ad, element, "mapped-by", false );
- getOrderBy( annotationList, element, defaults );
- getMapKey( annotationList, element, defaults );
+ getOrderBy( annotationList, element );
+ getMapKey( annotationList, element );
annotationList.add( AnnotationFactory.create( ad ) );
+ getAccessType( annotationList, element );
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
@@ -772,7 +785,7 @@
}
}
- private void getOrderBy(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
+ private void getOrderBy(List<Annotation> annotationList, Element element) {
Element subelement = element != null ? element.element( "order-by" ) : null;
if ( subelement != null ) {
String orderByString = subelement.getTextTrim();
@@ -782,7 +795,7 @@
}
}
- private void getMapKey(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
+ private void getMapKey(List<Annotation> annotationList, Element element) {
Element subelement = element != null ? element.element( "map-key" ) : null;
if ( subelement != null ) {
String mapKeyString = subelement.attributeValue( "name" );
@@ -792,7 +805,7 @@
}
}
- private void buildJoinColumns(List<Annotation> annotationList, Element element, XMLContext.Default defaults) {
+ private void buildJoinColumns(List<Annotation> annotationList, Element element) {
JoinColumn[] joinColumns = getJoinColumns( element, false );
if ( joinColumns.length > 0 ) {
AnnotationDescriptor ad = new AnnotationDescriptor( JoinColumns.class );
@@ -867,6 +880,7 @@
getTemporal( annotationList, element );
AnnotationDescriptor basic = new AnnotationDescriptor( Version.class );
annotationList.add( AnnotationFactory.create( basic ) );
+ getAccessType( annotationList, element );
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
@@ -889,6 +903,7 @@
if ( "basic".equals( element.getName() ) ) {
Annotation annotation = buildColumns( element );
addIfNotNull( annotationList, annotation );
+ getAccessType( annotationList, element );
getTemporal( annotationList, element );
getLob( annotationList, element );
getEnumerated( annotationList, element );
@@ -971,21 +986,6 @@
AnnotationDescriptor ad = new AnnotationDescriptor( EmbeddedId.class );
annotationList.add( AnnotationFactory.create( ad ) );
}
-// else {
-// if ( defaults.canUseJavaAnnotations() ) {
-// if ( ! properOverridingOnMetadataNonComplete ) {
-// //check that id exists on the other attribute
-// //TODO Id too?
-// if ( mirroredAttribute == null || ! mirroredAttribute.isAnnotationPresent(
-// EmbeddedId.class
-// ) ) {
-// throw new AnnotationException(
-// "Cannot override an property with <embedded-id> not having an @EmbeddedId already"
-// );
-// }
-// }
-// }
-// }
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
@@ -1054,20 +1054,8 @@
addIfNotNull( annotationList, annotation );
AnnotationDescriptor id = new AnnotationDescriptor( Id.class );
annotationList.add( AnnotationFactory.create( id ) );
+ getAccessType( annotationList, element );
}
-// else {
-// if ( defaults.canUseJavaAnnotations() ) {
-// if ( ! properOverridingOnMetadataNonComplete ) {
-// //check that id exists on the other attribute
-// //TODO EmbeddedId too?
-// if ( mirroredAttribute == null || ! mirroredAttribute.isAnnotationPresent( Id.class ) ) {
-// throw new AnnotationException(
-// "Cannot override a property with <id> it does not have an @Id already"
-// );
-// }
-// }
-// }
-// }
}
}
if ( elementsForProperty.size() == 0 && defaults.canUseJavaAnnotations() ) {
@@ -1101,8 +1089,8 @@
private boolean isProcessingId(XMLContext.Default defaults) {
boolean isExplicit = defaults.getAccess() != null;
boolean correctAccess =
- ( PropertyType.PROPERTY.equals( propertyType ) && "property".equals( defaults.getAccess() ) )
- || ( PropertyType.FIELD.equals( propertyType ) && "field".equals( defaults.getAccess() ) );
+ ( PropertyType.PROPERTY.equals( propertyType ) && AccessType.PROPERTY.equals( defaults.getAccess() ) )
+ || ( PropertyType.FIELD.equals( propertyType ) && AccessType.FIELD.equals( defaults.getAccess() ) );
boolean hasId = defaults.canUseJavaAnnotations()
&& ( isJavaAnnotationPresent( Id.class ) || isJavaAnnotationPresent( EmbeddedId.class ) );
//if ( properAccessOnMetadataComplete || properOverridingOnMetadataNonComplete ) {
@@ -1180,6 +1168,31 @@
}
}
+ private void getAccessType(List<Annotation> annotationList, Element element) {
+ if ( element == null ) {
+ return;
+ }
+ String access = element.attributeValue( "access" );
+ if ( access != null ) {
+ AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
+ AccessType type;
+ try {
+ type = AccessType.valueOf( access );
+ }
+ catch ( IllegalArgumentException e ) {
+ throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
+ }
+
+ if ( ( AccessType.PROPERTY.equals( type ) && this.element instanceof Method ) ||
+ ( AccessType.FIELD.equals( type ) && this.element instanceof Field ) ) {
+ return;
+ }
+
+ ad.setValue( "value", type );
+ annotationList.add( AnnotationFactory.create( ad ) );
+ }
+ }
+
private AssociationOverrides getAssociationOverrides(Element tree, XMLContext.Default defaults) {
List<AssociationOverride> attributes = (List<AssociationOverride>) buildAssociationOverrides( tree );
if ( defaults.canUseJavaAnnotations() ) {
@@ -1299,7 +1312,7 @@
if ( !current.getName().equals( "attribute-override" ) ) continue;
AnnotationDescriptor override = new AnnotationDescriptor( AttributeOverride.class );
copyStringAttribute( override, current, "name", true );
- Element column = current != null ? current.element( "column" ) : null;
+ Element column = current.element( "column" );
override.setValue( "column", getColumn( column, true, current ) );
overrides.add( (AttributeOverride) AnnotationFactory.create( override ) );
}
@@ -1345,22 +1358,25 @@
}
}
- private AccessType getAccessType(Element tree, XMLContext.Default defaults) {
+ private Access getAccessType(Element tree, XMLContext.Default defaults) {
String access = tree == null ? null : tree.attributeValue( "access" );
- if ( "FIELD".equals( access ) || "PROPERTY".equals( access ) ) {
- access = access.toLowerCase();
- }
if ( access != null ) {
- AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
- ad.setValue( "value", access );
+ AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
+ AccessType type;
+ try {
+ type = AccessType.valueOf( access );
+ }
+ catch ( IllegalArgumentException e ) {
+ throw new AnnotationException( access + " is not a valid access type. Check you xml confguration." );
+ }
+ ad.setValue( "value", type );
return AnnotationFactory.create( ad );
}
- else if ( defaults.canUseJavaAnnotations() && isJavaAnnotationPresent( AccessType.class ) ) {
- AccessType annotation = getJavaAnnotation( AccessType.class );
- return annotation;
+ else if ( defaults.canUseJavaAnnotations() && isJavaAnnotationPresent( Access.class ) ) {
+ return getJavaAnnotation( Access.class );
}
else if ( defaults.getAccess() != null ) {
- AnnotationDescriptor ad = new AnnotationDescriptor( AccessType.class );
+ AnnotationDescriptor ad = new AnnotationDescriptor( Access.class );
ad.setValue( "value", defaults.getAccess() );
return AnnotationFactory.create( ad );
}
@@ -1432,7 +1448,7 @@
if ( clazzName == null ) {
throw new AnnotationException( "<entity-result> without entity-class. " + SCHEMA_VALIDATION );
}
- Class clazz = null;
+ Class clazz;
try {
clazz = ReflectHelper.classForName(
XMLContext.buildSafeClassName( clazzName, defaults ),
@@ -1469,7 +1485,7 @@
//FIXME there is never such a result-class, get rid of it?
String clazzName = subelement.attributeValue( "result-class" );
if ( StringHelper.isNotEmpty( clazzName ) ) {
- Class clazz = null;
+ Class clazz;
try {
clazz = ReflectHelper.classForName(
XMLContext.buildSafeClassName( clazzName, defaults ),
@@ -1605,7 +1621,7 @@
ann.setValue( "hints", queryHints.toArray( new QueryHint[queryHints.size()] ) );
String clazzName = subelement.attributeValue( "result-class" );
if ( StringHelper.isNotEmpty( clazzName ) ) {
- Class clazz = null;
+ Class clazz;
try {
clazz = ReflectHelper.classForName(
XMLContext.buildSafeClassName( clazzName, defaults ),
@@ -1803,7 +1819,7 @@
Attribute attr = element.attribute( "class" );
if ( attr != null ) {
AnnotationDescriptor ad = new AnnotationDescriptor( IdClass.class );
- Class clazz = null;
+ Class clazz;
try {
clazz = ReflectHelper.classForName(
XMLContext.buildSafeClassName( attr.getValue(), defaults ),
Modified: core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java
===================================================================
--- core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java 2010-01-11 17:11:03 UTC (rev 18505)
+++ core/trunk/annotations/src/main/java/org/hibernate/cfg/annotations/reflection/XMLContext.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -28,9 +28,14 @@
import java.util.List;
import java.util.Map;
+import javax.persistence.AccessType;
+
import org.dom4j.Document;
import org.dom4j.Element;
+
+import org.hibernate.AnnotationException;
import org.hibernate.util.StringHelper;
+
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
@@ -47,8 +52,10 @@
private boolean hasContext = false;
/**
- * Add a document and return the list of added classes names
+ * @param doc The xml document to add
+ * @return Add a xml document to this context and return the list of added class names.
*/
+ @SuppressWarnings( "unchecked" )
public List<String> addDocument(Document doc) {
hasContext = true;
List<String> addedClasses = new ArrayList<String>();
@@ -70,7 +77,7 @@
unitElement = defaultElement.element( "catalog" );
globalDefaults.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
unitElement = defaultElement.element( "access" );
- globalDefaults.setAccess( unitElement != null ? unitElement.getTextTrim() : null );
+ setAccess( unitElement, globalDefaults );
unitElement = defaultElement.element( "cascade-persist" );
globalDefaults.setCascadePersist( unitElement != null ? Boolean.TRUE : null );
unitElement = defaultElement.element( "delimited-identifiers" );
@@ -93,7 +100,7 @@
unitElement = root.element( "catalog" );
entityMappingDefault.setCatalog( unitElement != null ? unitElement.getTextTrim() : null );
unitElement = root.element( "access" );
- entityMappingDefault.setAccess( unitElement != null ? unitElement.getTextTrim() : null );
+ setAccess( unitElement, entityMappingDefault );
defaultElements.add( root );
List<Element> entities = (List<Element>) root.elements( "entity" );
@@ -107,6 +114,26 @@
return addedClasses;
}
+ private void setAccess(Element unitElement, Default defaultType) {
+ if ( unitElement != null ) {
+ String access = unitElement.getTextTrim();
+ setAccess( access, defaultType );
+ }
+ }
+
+ private void setAccess( String access, Default defaultType) {
+ AccessType type;
+ if ( access != null ) {
+ try {
+ type = AccessType.valueOf( access );
+ }
+ catch ( IllegalArgumentException e ) {
+ throw new AnnotationException( "Invalid access type " + access + " (check your xml configuration)" );
+ }
+ defaultType.setAccess( type );
+ }
+ }
+
private void addClass(List<Element> entities, String packageName, Default defaults, List<String> addedClasses) {
for (Element element : entities) {
String className = buildSafeClassName( element.attributeValue( "class" ), packageName );
@@ -123,7 +150,7 @@
localDefault.setMetadataComplete( Boolean.parseBoolean( metadataCompleteString ) );
}
String access = element.attributeValue( "access" );
- if ( access != null ) localDefault.setAccess( access );
+ setAccess( access, localDefault );
defaultsOverriding.put( className, localDefault );
log.debug( "Adding XML overriding information for {}", className );
@@ -135,6 +162,7 @@
List<String> localAddedClasses = new ArrayList<String>();
Element listeners = element.element( "entity-listeners" );
if ( listeners != null ) {
+ @SuppressWarnings( "unchecked" )
List<Element> elements = (List<Element>) listeners.elements( "entity-listener" );
for (Element listener : elements) {
String listenerClassName = buildSafeClassName( listener.attributeValue( "class" ), packageName );
@@ -181,7 +209,7 @@
return xmlDefault;
}
- public Element getXMLTree(String className, String methodName) {
+ public Element getXMLTree(String className ) {
return classOverriding.get( className );
}
@@ -194,7 +222,7 @@
}
public static class Default {
- private String access;
+ private AccessType access;
private String packageName;
private String schema;
private String catalog;
@@ -202,17 +230,12 @@
private Boolean cascadePersist;
private Boolean delimitedIdentifier;
- public String getAccess() {
+ public AccessType getAccess() {
return access;
}
- protected void setAccess(String access) {
- if ( "FIELD".equals( access ) || "PROPERTY".equals( access ) ) {
- this.access = access.toLowerCase();
- }
- else {
- this.access = access;
- }
+ protected void setAccess(AccessType access) {
+ this.access = access;
}
public String getCatalog() {
@@ -244,7 +267,7 @@
}
public boolean canUseJavaAnnotations() {
- return metadataComplete == null || !metadataComplete.booleanValue();
+ return metadataComplete == null || !metadataComplete;
}
protected void setMetadataComplete(Boolean metadataComplete) {
Modified: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java 2010-01-11 17:11:03 UTC (rev 18505)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -1,4 +1,4 @@
-//$Id: AccessTest.java 15025 2008-08-11 09:14:39Z hardy.ferentschik $
+//$Id$
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
@@ -37,6 +37,8 @@
/**
+ * Tests verifying the correct behaviour for the usage of {@code @javax.persistence.Access}.
+ *
* @author Hardy Ferentschik
*/
public class AccessMappingTest extends TestCase {
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Crew.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Crew.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Crew.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,49 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.MappedSuperclass;
+
+/**
+ * @author Hardy Ferentschik
+ */
+public class Crew {
+ private int id;
+
+ private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+
+
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Crew.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Driver.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Driver.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Driver.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,50 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Driver {
+ @Id
+ @GeneratedValue
+ private int id;
+
+ private String name;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
\ No newline at end of file
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Driver.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/RentalCar.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/RentalCar.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/RentalCar.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,50 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class RentalCar {
+ @Id
+ @GeneratedValue
+ private int id;
+
+ private Driver driver;
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public Driver getDriver() {
+ return driver;
+ }
+
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
+}
\ No newline at end of file
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/RentalCar.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Tourist.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Tourist.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Tourist.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,62 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Tourist {
+ @Id
+ @GeneratedValue
+ private long id;
+
+ private String name;
+
+ public String getDestination() {
+ return destination;
+ }
+
+ public void setDestination(String destination) {
+ this.destination = destination;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ private String destination;
+
+ public long getId() {
+ return id;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+}
+
+
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Tourist.java
___________________________________________________________________
Name: svn:keywords
+ Id
Added: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,29 @@
+// $Id:$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+* http://www.apache.org/licenses/LICENSE-2.0
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package org.hibernate.test.annotations.access.xml;
+
+import javax.persistence.Entity;
+
+/**
+ * @author Hardy Ferentschik
+ */
+@Entity
+public class Waiter extends Crew {
+}
+
+
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/Waiter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Copied: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java (from rev 18427, core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/jpa/AccessMappingTest.java)
===================================================================
--- core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java (rev 0)
+++ core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java 2010-01-11 20:23:08 UTC (rev 18506)
@@ -0,0 +1,173 @@
+//$Id$
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2008, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate.test.annotations.access.xml;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javax.persistence.AccessType;
+
+import junit.framework.TestCase;
+
+import org.hibernate.EntityMode;
+import org.hibernate.cfg.AnnotationConfiguration;
+import org.hibernate.engine.SessionFactoryImplementor;
+import org.hibernate.property.BasicPropertyAccessor;
+import org.hibernate.property.DirectPropertyAccessor;
+import org.hibernate.tuple.entity.EntityMetamodel;
+import org.hibernate.tuple.entity.PojoEntityTuplizer;
+
+
+/**
+ * Test verifying that it is possible to configure the access type via xml configuration.
+ *
+ * @author Hardy Ferentschik
+ */
+public class XmlAccessTest extends TestCase {
+
+ public void testAccessOnBasicXmlElement() throws Exception {
+ Class<?> classUnderTest = Tourist.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ List<String> configFiles = Collections.emptyList();
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+
+ // without any xml configuration we have field access
+ assertAccessType( factory, classUnderTest, AccessType.FIELD );
+
+ // now with an additional xml configuration file changing the default access type for Tourist using basic
+ configFiles = new ArrayList<String>();
+ configFiles.add("org/hibernate/test/annotations/access/xml/Tourist.xml");
+ factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
+ public void testAccessOnPersistenceUnitDefaultsXmlElement() throws Exception {
+ Class<?> classUnderTest = Tourist.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ List<String> configFiles = Collections.emptyList();
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+
+ // without any xml configuration we have field access
+ assertAccessType( factory, classUnderTest, AccessType.FIELD );
+
+ // now with an additional xml configuration file changing the default access type for Tourist using persitence unit defaults
+ configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Tourist2.xml" );
+ factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
+ public void testAccessOnEntityMappingsXmlElement() throws Exception {
+ Class<?> classUnderTest = Tourist.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ List<String> configFiles = Collections.emptyList();
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+
+ // without any xml configuration we have field access
+ assertAccessType( factory, classUnderTest, AccessType.FIELD );
+
+ // now with an additional xml configuration file changing the default access type for Tourist using default in entity-mappings
+ configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Tourist3.xml" );
+ factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
+ public void testAccessOnEntityXmlElement() throws Exception {
+ Class<?> classUnderTest = Tourist.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ List<String> configFiles = Collections.emptyList();
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+
+ // without any xml configuration we have field access
+ assertAccessType( factory, classUnderTest, AccessType.FIELD );
+
+ // now with an additional xml configuration file changing the default access type for Tourist using entity level config
+ configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Tourist4.xml" );
+ factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
+ public void testAccessOnMappedSuperClassXmlElement() throws Exception {
+ Class<?> classUnderTest = Waiter.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ classes.add(Crew.class);
+ List<String> configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/Crew.xml" );
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.FIELD );
+ }
+
+ public void testAccessOnAssociationXmlElement() throws Exception {
+ Class<?> classUnderTest = RentalCar.class;
+ List<Class<?>> classes = new ArrayList<Class<?>>();
+ classes.add( classUnderTest );
+ classes.add(Driver.class);
+ List<String> configFiles = new ArrayList<String>();
+ configFiles.add( "org/hibernate/test/annotations/access/xml/RentalCar.xml" );
+ SessionFactoryImplementor factory = buildSessionFactory( classes, configFiles );
+ assertAccessType( factory, classUnderTest, AccessType.PROPERTY );
+ }
+
+ private SessionFactoryImplementor buildSessionFactory(List<Class<?>> classesUnderTest, List<String> configFiles) {
+ assert classesUnderTest != null;
+ assert configFiles != null;
+ AnnotationConfiguration cfg = new AnnotationConfiguration();
+ for ( Class<?> clazz : classesUnderTest ) {
+ cfg.addAnnotatedClass( clazz );
+ }
+ for ( String configFile : configFiles ) {
+ InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream( configFile );
+ cfg.addInputStream( is );
+ }
+ return ( SessionFactoryImplementor ) cfg.buildSessionFactory();
+ }
+
+ // uses the first getter of the tupelizer for the assertions
+ private void assertAccessType(SessionFactoryImplementor factory, Class<?> classUnderTest, AccessType accessType) {
+ EntityMetamodel metaModel = factory.getEntityPersister( classUnderTest.getName() )
+ .getEntityMetamodel();
+ PojoEntityTuplizer tuplizer = ( PojoEntityTuplizer ) metaModel.getTuplizer( EntityMode.POJO );
+ if ( AccessType.FIELD.equals( accessType ) ) {
+ assertTrue(
+ "Field access was expected.",
+ tuplizer.getGetter( 0 ) instanceof DirectPropertyAccessor.DirectGetter
+ );
+ }
+ else {
+ assertTrue(
+ "Property access was expected.",
+ tuplizer.getGetter( 0 ) instanceof BasicPropertyAccessor.BasicGetter
+ );
+ }
+ }
+}
\ No newline at end of file
Property changes on: core/trunk/annotations/src/test/java/org/hibernate/test/annotations/access/xml/XmlAccessTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
14 years, 3 months
Hibernate SVN: r18505 - in search/trunk: src/main/java/org/hibernate/search/filter and 2 other directories.
by hibernate-commits@lists.jboss.org
Author: sannegrinovero
Date: 2010-01-11 12:11:03 -0500 (Mon, 11 Jan 2010)
New Revision: 18505
Removed:
search/trunk/src/main/java/org/hibernate/search/filter/EmptyDocIdBitSet.java
Modified:
search/trunk/pom.xml
search/trunk/src/main/java/org/hibernate/search/filter/AndDocIdSet.java
search/trunk/src/test/java/org/hibernate/search/test/FSDirectoryTest.java
search/trunk/src/test/java/org/hibernate/search/test/filter/AndDocIdSetsTest.java
search/trunk/src/test/java/org/hibernate/search/test/filter/ExcludeAllFilter.java
search/trunk/src/test/java/org/hibernate/search/test/filter/FiltersOptimizationTest.java
search/trunk/src/test/java/org/hibernate/search/test/filter/InstanceBasedExcludeAllFilter.java
Log:
HSEARCH-442 Upgrade existing code to Lucene 2.9.1
Modified: search/trunk/pom.xml
===================================================================
--- search/trunk/pom.xml 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/pom.xml 2010-01-11 17:11:03 UTC (rev 18505)
@@ -115,7 +115,7 @@
<properties>
<slf4jVersion>1.5.8</slf4jVersion>
- <luceneVersion>2.4.1</luceneVersion>
+ <luceneVersion>2.9.1</luceneVersion>
<hibernateVersion>3.5.0-SNAPSHOT</hibernateVersion>
<hibernateCommonsAnnotationVersion>3.2.0.Beta1</hibernateCommonsAnnotationVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Modified: search/trunk/src/main/java/org/hibernate/search/filter/AndDocIdSet.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/filter/AndDocIdSet.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/main/java/org/hibernate/search/filter/AndDocIdSet.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -80,11 +80,11 @@
//iterator initialize, just one "next" for each DocIdSetIterator
for ( ; i<iteratorSize; i++ ) {
final DocIdSetIterator iterator = iterators[i];
- if ( ! iterator.next() ) {
+ final int position = iterator.nextDoc();
+ if ( position==DocIdSetIterator.NO_MORE_DOCS ) {
//current iterator has no values, so skip all
- return EmptyDocIdBitSet.instance;
+ return DocIdSet.EMPTY_DOCIDSET;
}
- final int position = iterator.doc();
if ( targetPosition==position ) {
votes++; //stopped as same position of others
}
@@ -100,15 +100,14 @@
result.fastSet( targetPosition );
targetPosition++;
}
- i=0;
- votes=0; //could be smarted but would make the code even more complex for a minor optimization out of cycle.
+ i = 0;
+ votes = 0; //could be smarter but would make the code even more complex for a minor optimization out of cycle.
// enter main loop:
while ( true ) {
final DocIdSetIterator iterator = iterators[i];
- final boolean validPosition = iterator.skipTo( targetPosition );
- if ( ! validPosition )
+ final int position = iterator.advance( targetPosition );
+ if ( position==DocIdSetIterator.NO_MORE_DOCS )
return result; //exit condition
- final int position = iterator.doc();
if ( position == targetPosition ) {
if ( ++votes == iteratorSize ) {
result.fastSet( position );
@@ -125,40 +124,13 @@
}
@Override
- public DocIdSetIterator iterator() {
- return new AndingDocIdSetIterator();
+ public DocIdSetIterator iterator() throws IOException {
+ return buildBitset().iterator();
}
- private class AndingDocIdSetIterator extends DocIdSetIterator {
-
- private DocIdSetIterator iterator;
-
- @Override
- public int doc() {
- // should never happen when respecting interface contract; otherwise I
- // prefer a NPE than a hard to debug return 0.
- assert iterator != null : "Illegal state, can't be called before next() or skipTo(int)";
- return iterator.doc();
- }
-
- @Override
- public boolean next() throws IOException {
- ensureInitialized(); //can't initialize before as it would not be allowed to throw IOException
- return iterator.next();
- }
-
- @Override
- public boolean skipTo(int target) throws IOException {
- ensureInitialized(); //can't initialize before as it would not be allowed to throw IOException
- return iterator.skipTo( target );
- }
-
- private final void ensureInitialized() throws IOException {
- if ( iterator == null ) {
- iterator = buildBitset().iterator();
- }
- }
-
+ @Override
+ public boolean isCacheable() {
+ return true;
}
}
Deleted: search/trunk/src/main/java/org/hibernate/search/filter/EmptyDocIdBitSet.java
===================================================================
--- search/trunk/src/main/java/org/hibernate/search/filter/EmptyDocIdBitSet.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/main/java/org/hibernate/search/filter/EmptyDocIdBitSet.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -1,78 +0,0 @@
-/* $Id$
- *
- * Hibernate, Relational Persistence for Idiomatic Java
- *
- * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-party contributors as
- * indicated by the @author tags or express copyright attribution
- * statements applied by the authors. All third-party contributions are
- * distributed under license by Red Hat, Inc.
- *
- * This copyrighted material is made available to anyone wishing to use, modify,
- * copy, or redistribute it subject to the terms and conditions of the GNU
- * Lesser General Public License, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this distribution; if not, write to:
- * Free Software Foundation, Inc.
- * 51 Franklin Street, Fifth Floor
- * Boston, MA 02110-1301 USA
- */
-package org.hibernate.search.filter;
-
-import java.io.Serializable;
-
-import org.apache.lucene.search.DocIdSet;
-import org.apache.lucene.search.DocIdSetIterator;
-
-/**
- * A DocIdSet which is always empty.
- * Stateless and ThreadSafe.
- *
- * @author Sanne Grinovero
- */
-public final class EmptyDocIdBitSet extends DocIdSet implements Serializable {
-
- private static final long serialVersionUID = 6429929383767238322L;
-
- public static final DocIdSet instance = new EmptyDocIdBitSet();
-
- private static final DocIdSetIterator iterator = new EmptyDocIdSetIterator();
-
- private EmptyDocIdBitSet(){
- // is singleton
- }
-
- @Override
- public final DocIdSetIterator iterator() {
- return iterator;
- }
-
- /**
- * implements a DocIdSetIterator for an empty DocIdSet
- * As it is empty it also is stateless and so it can be reused.
- */
- private static final class EmptyDocIdSetIterator extends DocIdSetIterator {
-
- @Override
- public final int doc() {
- throw new IllegalStateException( "Should never be called" );
- }
-
- @Override
- public final boolean next() {
- return false;
- }
-
- @Override
- public final boolean skipTo(int target) {
- return false;
- }
-
- }
-
-}
Modified: search/trunk/src/test/java/org/hibernate/search/test/FSDirectoryTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/FSDirectoryTest.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/test/java/org/hibernate/search/test/FSDirectoryTest.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -81,9 +81,11 @@
int num = reader.numDocs();
assertEquals( 1, num );
TermDocs docs = reader.termDocs( new Term( "Abstract", "Hibernate" ) );
+ docs.next();
org.apache.lucene.document.Document doc = reader.document( docs.doc() );
assertFalse( docs.next() );
docs = reader.termDocs( new Term( "Title", "Action" ) );
+ docs.next();
doc = reader.document( docs.doc() );
assertFalse( docs.next() );
assertEquals( "1", doc.getField( "id" ).stringValue() );
Modified: search/trunk/src/test/java/org/hibernate/search/test/filter/AndDocIdSetsTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/filter/AndDocIdSetsTest.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/test/java/org/hibernate/search/test/filter/AndDocIdSetsTest.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -97,10 +97,10 @@
public void testIteratorMatchesTestArray() throws IOException {
DocIdSet docIdSet0_9 = arrayToDocIdSet(testDataFrom0to9);
DocIdSetIterator docIdSetIterator = docIdSet0_9.iterator();
- assertTrue( docIdSetIterator.next() );
- assertEquals( 0, docIdSetIterator.doc() );
- assertTrue( docIdSetIterator.skipTo(9) );
- assertFalse( docIdSetIterator.skipTo(10) );
+ assertTrue( docIdSetIterator.nextDoc() != DocIdSetIterator.NO_MORE_DOCS );
+ assertEquals( 0, docIdSetIterator.docID() );
+ assertEquals( 9, docIdSetIterator.advance(9) );
+ assertEquals( DocIdSetIterator.NO_MORE_DOCS, docIdSetIterator.advance(10) );
}
public void testAndDocIdSets() {
@@ -180,13 +180,13 @@
System.out.println(" Results are same: " + docIdSetsEqual( andedByBitsResult, andedByIterationResult ) );
}
- private static int iterateOnResults(DocIdSet docIdBitSet) throws IOException {
+ private static void iterateOnResults(DocIdSet docIdBitSet) throws IOException {
DocIdSetIterator iterator = docIdBitSet.iterator();
- int i = 0;
- while ( iterator.next() ) {
- i += iterator.doc();
+ int currentDoc;
+ do {
+ currentDoc = iterator.nextDoc();
}
- return i;
+ while ( currentDoc != DocIdSetIterator.NO_MORE_DOCS );
}
private static final BitSet applyANDOnBitSets(final List<BitSet> filtersData) {
@@ -237,29 +237,24 @@
}
/**
- * @param a
- * @param b
+ * @param expected
+ * @param tested
* @return true if the two DocIdSet are equal: contain the same number of ids, same order and all are equal
*/
public static final boolean docIdSetsEqual(DocIdSet expected, DocIdSet tested) {
- DocIdSetIterator iterA = expected.iterator();
- DocIdSetIterator iterB = tested.iterator();
- boolean nextA = false;
- boolean nextB = false;
try{
+ DocIdSetIterator iterA = expected.iterator();
+ DocIdSetIterator iterB = tested.iterator();
+ int nextA;
+ int nextB;
do {
- nextA = iterA.next();
- nextB = iterB.next();
- if ( nextA!=nextB ) {
+ nextA = iterA.nextDoc();
+ nextB = iterB.nextDoc();
+ if ( nextA != nextB ) {
return false;
}
- else if ( nextA==false) {
- return true;
- }
- else if ( iterA.doc() != iterB.doc() ) {
- return false;
- }
- } while ( nextA && nextB );
+ assertEquals( iterA.docID(), iterB.docID() );
+ } while ( nextA != DocIdSetIterator.NO_MORE_DOCS );
}
catch (IOException ioe) {
fail( "these DocIdSetIterator instances should not throw any exceptions" );
Modified: search/trunk/src/test/java/org/hibernate/search/test/filter/ExcludeAllFilter.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/filter/ExcludeAllFilter.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/test/java/org/hibernate/search/test/filter/ExcludeAllFilter.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -31,8 +31,6 @@
import org.apache.lucene.search.Filter;
import org.apache.lucene.index.IndexReader;
-import org.hibernate.search.filter.EmptyDocIdBitSet;
-
/**
* @author Emmanuel Bernard
*/
@@ -58,6 +56,6 @@
throw new IllegalStateException( "Called twice" );
}
done = true;
- return EmptyDocIdBitSet.instance;
+ return DocIdSet.EMPTY_DOCIDSET;
}
}
Modified: search/trunk/src/test/java/org/hibernate/search/test/filter/FiltersOptimizationTest.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/filter/FiltersOptimizationTest.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/test/java/org/hibernate/search/test/filter/FiltersOptimizationTest.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -194,7 +194,7 @@
}
@Override
- public DocIdSetIterator iterator() {
+ public DocIdSetIterator iterator() throws IOException {
return bitSet.iterator();
}
Modified: search/trunk/src/test/java/org/hibernate/search/test/filter/InstanceBasedExcludeAllFilter.java
===================================================================
--- search/trunk/src/test/java/org/hibernate/search/test/filter/InstanceBasedExcludeAllFilter.java 2010-01-11 01:20:16 UTC (rev 18504)
+++ search/trunk/src/test/java/org/hibernate/search/test/filter/InstanceBasedExcludeAllFilter.java 2010-01-11 17:11:03 UTC (rev 18505)
@@ -31,8 +31,6 @@
import org.apache.lucene.search.Filter;
import org.apache.lucene.search.DocIdSet;
-import org.hibernate.search.filter.EmptyDocIdBitSet;
-
/**
* @author Emmanuel Bernard
*/
@@ -55,6 +53,6 @@
throw new IllegalStateException( "Called twice" );
}
done = true;
- return EmptyDocIdBitSet.instance;
+ return DocIdSet.EMPTY_DOCIDSET;
}
}
14 years, 3 months
Hibernate SVN: r18504 - in annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations: entity and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: stliu
Date: 2010-01-10 20:20:16 -0500 (Sun, 10 Jan 2010)
New Revision: 18504
Added:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java
Modified:
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java
annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
Log:
JBPAPP-3379 default hibernate.jdbc.use_streams_for_binary cause two test cases fail on db2
Added: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java (rev 0)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/SystemLevelPropertyUtil.java 2010-01-11 01:20:16 UTC (rev 18504)
@@ -0,0 +1,118 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+/**
+ *
+ */
+package org.hibernate.test.annotations;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Properties;
+
+import org.hibernate.util.ConfigHelper;
+
+/**
+ * This util class is for setting some system-level properties It is used before
+ * Environment be loaded into jvm.
+ *
+ * @author Strong Liu <stliu(a)redhat.com>
+ */
+public class SystemLevelPropertyUtil {
+ /**
+ * find is the property <tt>prop</tt> is in System properties or in
+ * hibernate.properties.
+ *
+ *
+ * @param prop
+ * @return
+ */
+ public static boolean isPropertyExist( Object prop ) {
+ if ( System.getProperties().containsKey( prop ) ) {
+ return true;
+ }
+ return getHibernateProperties().containsKey( prop );
+ }
+
+ /**
+ * get the property <tt>prop</tt> value
+ * @param prop
+ * @return
+ */
+ public static Object getSystemLevelProperty( Object prop ) {
+ if ( !isPropertyExist( prop ) ) {
+ return null;
+ }
+ if ( System.getProperties().containsKey( prop ) ) {
+ return System.getProperties().get( prop );
+ }
+ if ( getHibernateProperties().containsKey( prop ) ) {
+ return getHibernateProperties().get( prop );
+ }
+ return null;
+ }
+
+ private static Properties getHibernateProperties() {
+ Properties properties = new Properties();
+ try {
+ properties.load( findAsResource( "hibernate.properties" )
+ .openStream() );
+ } catch (IOException e) {
+
+ }
+ return properties;
+ }
+
+ /**
+ * Try to locate a local URL representing the incoming path. This method
+ * <b>only</b> attempts to locate this URL as a java system resource.
+ *
+ * @param path
+ * The path representing the config location.
+ * @return An appropriate URL or null.
+ */
+ private static final URL findAsResource( final String path ) {
+ URL url = null;
+
+ // First, try to locate this resource through the current
+ // context classloader.
+ ClassLoader contextClassLoader = Thread.currentThread()
+ .getContextClassLoader();
+ if ( contextClassLoader != null ) {
+ url = contextClassLoader.getResource( path );
+ }
+ if ( url != null )
+ return url;
+
+ // Next, try to locate this resource through this class's classloader
+ url = ConfigHelper.class.getClassLoader().getResource( path );
+ if ( url != null )
+ return url;
+
+ // Next, try to locate this resource through the system classloader
+ url = ClassLoader.getSystemClassLoader().getResource( path );
+
+ // Anywhere else we should look?
+ return url;
+ }
+}
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java 2010-01-10 23:41:10 UTC (rev 18503)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/entity/PropertyDefaultMappingsTest.java 2010-01-11 01:20:16 UTC (rev 18504)
@@ -3,7 +3,12 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.hibernate.dialect.DB2Dialect;
+import org.hibernate.test.annotations.SystemLevelPropertyUtil;
import org.hibernate.test.annotations.TestCase;
+import org.hibernate.util.ConfigHelper;
/**
* @author Emmanuel Bernard
@@ -11,7 +16,17 @@
public class PropertyDefaultMappingsTest extends TestCase {
public PropertyDefaultMappingsTest(String x) {
super( x );
+
}
+ //https://jira.jboss.org/jira/browse/JBPAPP-3379
+ @Override
+ protected void setUp() throws Exception {
+ String dialect = (String)SystemLevelPropertyUtil.getSystemLevelProperty( "hibernate.dialect" );
+ if(dialect.equals( "org.hibernate.dialect.DB2Dialect" )){
+ System.setProperty( "hibernate.jdbc.use_streams_for_binary" , "false" );
+ }
+ super.setUp();
+ }
public void testSerializableObject() throws Exception {
Session s;
Modified: annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java
===================================================================
--- annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-01-10 23:41:10 UTC (rev 18503)
+++ annotations/branches/v3_4_0_GA_CP/src/test/java/org/hibernate/test/annotations/lob/LobTest.java 2010-01-11 01:20:16 UTC (rev 18504)
@@ -3,12 +3,25 @@
import org.hibernate.Session;
import org.hibernate.Transaction;
+import org.hibernate.test.annotations.SystemLevelPropertyUtil;
import org.hibernate.test.annotations.TestCase;
/**
* @author Emmanuel Bernard
*/
public class LobTest extends TestCase {
+
+
+ //https://jira.jboss.org/jira/browse/JBPAPP-3379
+ @Override
+ protected void setUp() throws Exception {
+ String dialect = (String)SystemLevelPropertyUtil.getSystemLevelProperty( "hibernate.dialect" );
+ if(dialect.equals( "org.hibernate.dialect.DB2Dialect" )){
+ System.setProperty( "hibernate.jdbc.use_streams_for_binary" , "false" );
+ }
+ super.setUp();
+ }
+
public void testSerializableToBlob() throws Exception {
Book book = new Book();
Editor editor = new Editor();
14 years, 3 months