📄 session_api.po
字号:
"collection. The original collection is not modified (this is contrary to the ""implication of the name \"filter\", but consistent with expected behavior)."msgstr """반환되는 콜렉션은 하나의 bag으로 간주되고, 그것은 주어진 콜렉션에 대한 사본이""다. 원래의 콜렉션은 변경되지 않는다 (이것은 이름 \"filter\"의 의미와는 정반대""이지만, 예상되는 행위와 일치된다)."#. Tag: para#: session_api.xml:423#, no-c-formatmsgid """Observe that filters do not require a <literal>from</literal> clause (though ""they may have one if required). Filters are not limited to returning the ""collection elements themselves."msgstr """필터들은 <literal>from</literal> 절을 필요로 하지 않음을 관찰하라(필요할 경우""에 필터들이 한 개의 from 절을 가질 수 있을지라도). 필터들은 콜렉션 요소들 자""체들을 반환하는 것으로 한정되지 않는다."#. Tag: programlisting#: session_api.xml:428#, no-c-formatmsgid """<![CDATA[Collection blackKittenMates = session.createFilter(\n"" pk.getKittens(), \n"" \"select this.mate where this.color = eg.Color.BLACK.intValue\")\n"" .list();]]>"msgstr ""#. Tag: para#: session_api.xml:430#, no-c-formatmsgid """Even an empty filter query is useful, e.g. to load a subset of elements in a ""huge collection:"msgstr """심지어 하나의 공백의 필터 질의도 예를 들어 거대한 콜렉션 내에 있는 요소들의 ""부분집합들을 로드시키는데 유용하다:"#. Tag: programlisting#: session_api.xml:435#, no-c-formatmsgid """<![CDATA[Collection tenKittens = session.createFilter(\n"" mother.getKittens(), \"\")\n"" .setFirstResult(0).setMaxResults(10)\n"" .list();]]>"msgstr ""#. Tag: title#: session_api.xml:440#, no-c-formatmsgid "Criteria queries"msgstr "Criteria 질의들"#. Tag: para#: session_api.xml:442#, no-c-formatmsgid """HQL is extremely powerful but some developers prefer to build queries ""dynamically, using an object-oriented API, rather than building query ""strings. Hibernate provides an intuitive <literal>Criteria</literal> query ""API for these cases:"msgstr """HQL은 극히 강력하지만 몇몇 개발자들은 질의 문자열들을 빌드하기 보다, 객체 지""향 API를 사용하여 동적으로 질의들을 빌드시키는 것을 선호한다. Hibernate는 이""들 경우들을 위한 직관적인 <literal>Criteria</literal> query API를 제공한다:"#. Tag: programlisting#: session_api.xml:448#, no-c-formatmsgid """<![CDATA[Criteria crit = session.createCriteria(Cat.class);\n""crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n""crit.setMaxResults(10);\n""List cats = crit.list();]]>"msgstr ""#. Tag: para#: session_api.xml:450#, no-c-formatmsgid """The <literal>Criteria</literal> and the associated <literal>Example</""literal> API are discussed in more detail in <xref linkend=\"querycriteria\"/"">."msgstr """<literal>Criteria</literal>와 연관된 <literal>Example</literal> API 는 <xref ""linkend=\"querycriteria\"/>에서 상세하게 논의된다."#. Tag: title#: session_api.xml:458#, no-c-formatmsgid "Queries in native SQL"msgstr "native SQL에서 질의들"#. Tag: para#: session_api.xml:460#, no-c-formatmsgid """You may express a query in SQL, using <literal>createSQLQuery()</literal> ""and let Hibernate take care of the mapping from result sets to objects. Note ""that you may at any time call <literal>session.connection()</literal> and ""use the JDBC <literal>Connection</literal> directly. If you chose to use the ""Hibernate API, you must enclose SQL aliases in braces:"msgstr """당신은 <literal>createSQLQuery()</literal>를 사용하여 SQL 속에 하나의 질의를 ""표현할 수 있고, Hibernate로 하여금 결과 셋들로부터 객체들로의 매핑을 처리하도""록 할수도 있다. 당신은 아무때나 <literal>session.connection()</literal>을 호""출할 수 있고 직접 JDBC <literal>Connection</literal>을 사용할 수 있음을 노트""하라. 만일 당신이 Hibernate API를 사용하고자 선택한 경우에 , 당신은 SQL alias""들을 중괄호들 속에 포함시켜야 한다:"#. Tag: programlisting#: session_api.xml:468#, no-c-formatmsgid """<![CDATA[List cats = session.createSQLQuery(\"SELECT {cat.*} FROM CAT {cat} ""WHERE ROWNUM<10\")\n"" .addEntity(\"cat\", Cat.class)\n"".list();]]>"msgstr ""#. Tag: programlisting#: session_api.xml:470#, no-c-formatmsgid """<![CDATA[List cats = session.createSQLQuery(\n"" \"SELECT {cat}.ID AS {cat.id}, {cat}.SEX AS {cat.sex}, \" +\n"" \"{cat}.MATE AS {cat.mate}, {cat}.SUBCLASS AS {cat.class}, ... \" ""+\n"" \"FROM CAT {cat} WHERE ROWNUM<10\")\n"" .addEntity(\"cat\", Cat.class)\n"".list()]]>"msgstr ""#. Tag: para#: session_api.xml:472#, no-c-formatmsgid """SQL queries may contain named and positional parameters, just like Hibernate ""queries. More information about native SQL queries in Hibernate can be found ""in <xref linkend=\"querysql\"/>."msgstr """SQL 질의들은 Hibernate 질의들처럼 명명된 파라미터들과 위치 파라미터들을 포함""할 수도 있다. SQL 질의들에 대한 추가 정보는 <xref linkend=\"querysql\"/>에서 ""찾을 수 있다."#. Tag: title#: session_api.xml:483#, no-c-formatmsgid "Modifying persistent objects"msgstr "영속 객체들을 변경하기"#. Tag: para#: session_api.xml:485#, no-c-formatmsgid """<emphasis>Transactional persistent instances</emphasis> (ie. objects loaded, ""saved, created or queried by the <literal>Session</literal>) may be ""manipulated by the application and any changes to persistent state will be ""persisted when the <literal>Session</literal> is <emphasis>flushed</""emphasis> (discussed later in this chapter). There is no need to call a ""particular method (like <literal>update()</literal>, which has a different ""purpose) to make your modifications persistent. So the most straightforward ""way to update the state of an object is to <literal>load()</literal> it, and ""then manipulate it directly, while the <literal>Session</literal> is open:"msgstr """<emphasis>트랜잭션 상의 영속 인스턴스들</emphasis> (예를들면. ""<literal>Session</literal>에 의해 로드되고, 저장되고, 생성되거나 질의된 객체""들)은 어플리케이션에 의해 처리될 수 있고 영속 상태에 대한 임의의 변경들은 ""<literal>Session</literal>이 <emphasis>flush될</emphasis> 때 영속화 될 것이다""(이 장의 뒷 부분에서 논의됨). 당신의 변경들을 영속화 시키기 위해 (다른 용도""를 가진 <literal>update()</literal>와 같은) 특별한 메소드를 호출할 필요가 없""다. 따라서 객체의 상태를 업데이트 시키는 가장 간단한 방법은 ""<literal>Session</literal>이 열려 있는 동안, 그것을 <literal>load()</literal>""시키고 나서, 그것을 직접 처리하는 것이다:"#. Tag: programlisting#: session_api.xml:496#, no-c-formatmsgid """<![CDATA[DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long""(69) );\n""cat.setName(\"PK\");\n""sess.flush(); // changes to cat are automatically detected and persisted]]>"msgstr ""#. Tag: para#: session_api.xml:498#, no-c-formatmsgid """Sometimes this programming model is inefficient since it would require both ""an SQL <literal>SELECT</literal> (to load an object) and an SQL ""<literal>UPDATE</literal> (to persist its updated state) in the same ""session. Therefore Hibernate offers an alternate approach, using detached ""instances."msgstr """때때로 이 프로그래밍 모형은 불충분하다. 왜냐하면 그것은 동일한 세션 내에서 ""(객체를 로드시키는) SQL <literal>SELECT</literal>와 (그것의 업데이트된 상태""를 영속화 시키는) SQL <literal>UPDATE</literal> 양자를 필요로 할 것이기 때문""이다. 그러므로 Hibernate는 detached 인스턴스들을 사용하는 대안적인 접근법을 ""제공한다."#. Tag: emphasis#: session_api.xml:506#, fuzzy, no-c-formatmsgid """Note that Hibernate does not offer its own API for direct execution of ""<literal>UPDATE</literal> or <literal>DELETE</literal> statements. Hibernate ""is a <emphasis>state management</emphasis> service, you don't have to think ""in <emphasis>statements</emphasis> to use it. JDBC is a perfect API for ""executing SQL statements, you can get a JDBC <literal>Connection</literal> ""at any time by calling <literal>session.connection()</literal>. Furthermore, ""the notion of mass operations conflicts with object/relational mapping for ""online transaction processing-oriented applications. Future versions of ""Hibernate may however provide special mass operation functions. See <xref ""linkend=\"batch\"/> for some possible batch operation tricks."msgstr """Hibernate는 <placeholder-1/> 문장 또는 <placeholder-2/> 문장의 직접적인 실행""을 위한 그것 자신의 API를 제공하지 않음을 노트하라. Hibernate는 하나의 ""<placeholder-3/> 서비스이고, 당신은 그것을 사용할 <placeholder-4/>을 생각하""지 말아야 한다. JDBC는 SQL 문장들을 실행시키는 완전한 API이고, 당신은 ""<placeholder-5/>을 호출하여 아무때나 한 개의 JDBC <placeholder-6/>을 얻을 수 ""있다. 게다가 대량 오퍼레이션의 개념은 온라인 트랜잭션 처리-지향적인 어플리케""이션들을 위한 객체/관계형 매핑과 충돌한다. 하지만 Hibernate의 장래 버전들은 ""특별한 대용량의 오퍼레이션 기능들을 제공할 수도 있다. 몇몇 가능한 배치 오퍼레""이션 트릭들에 대해서는 <xref linkend=\"batch\"/>을 보라."#. Tag: title#: session_api.xml:521#, no-c-formatmsgid "Modifying detached objects"msgstr "detached 객체들을 변경시키기"#. Tag: para#: session_api.xml:523#, no-c-formatmsgid """Many applications need to retrieve an object in one transaction, send it to ""the UI layer for manipulation, then save the changes in a new transaction. ""Applications that use this kind of approach in a high-concurrency ""environment usually use versioned data to ensure isolation for the \"long\" ""unit of work."msgstr """많은 어플리케이션들은 하나의 트랜잭션 내에서 하나의 객체를 검색하고, 처리를 ""위한 UI 계층으로 그것을 전송하고, 그런 다음 새로운 트랜잭션 내에서 변경들을 ""저장할 필요가 있다. 고도의-동시성 환경에서 이런 종류의 접근법을 사용하는 어플""리케이션들은 대개 작업의 \"긴\" 단위를 확실히 격리시키기 위해 버전화 된 데이""터를 사용한다."#. Tag: para#: session_api.xml:530#, no-c-formatmsgid """Hibernate supports this model by providing for reattachment of detached ""instances using the <literal>Session.update()</literal> or <literal>Session.""merge()</literal> methods:"msgstr """Hibernate는 <literal>Session.update()</literal> 메소드 또는 <literal>Session.""merge()</literal> 메소드를 사용하여 detached 인스턴스들의 재첨부를 제공함으로""써 이 모형을 지원한다:"#. Tag: programlisting#: session_api.xml:536#, no-c-formatmsgid """<![CDATA[// in the first session\n""Cat cat = (Cat) firstSession.load(Cat.class, catId);\n""Cat potentialMate = new Cat();\n""firstSession.save(potentialMate);\n""\n""// in a higher layer of the application\n""cat.setMate(potentialMate);\n""\n""// later, in a new session\n""secondSession.update(cat); // update cat\n""secondSession.update(mate); // update mate]]>"msgstr ""#. Tag: para#: session_api.xml:538#, no-c-formatmsgid """If the <literal>Cat</literal> with identifier <literal>catId</literal> had ""already been loaded by <literal>secondSession</literal> when the application ""tried to reattach it, an exception would have been thrown."msgstr """만일 <literal>catId</literal> 식별자를 가진 <literal>Cat</literal>이 ""<literal>secondSession</literal>에 의해 이미 로드되었을 경우에 어플리케이션""이 그것을 다시 재첨부하려고 시도할 때, 예외상황이 던져졌을 것이다."#. Tag: para#: session_api.xml:544#, no-c-formatmsgid """Use <literal>update()</literal> if you are sure that the session does not ""contain an already persistent instance with the same identifier, and ""<literal>merge()</literal> if you want to merge your modifications at any ""time without consideration of the state of the session. In other words, ""<literal>update()</literal> is usually the first method you would call in a ""fresh session, ensuring that reattachment of your detached instances is the ""first operation that is executed."msgstr """만일 그 세션이 동일한 식별자를 가진 영속 인스턴스를 이미 포함하지 않음을 당신""이 확신하는 경우에는 <literal>update()</literal>를 사용하고, 만일 당신이 세션""의 상태를 고려하지 않은채로 아무때나 당신의 변경을 병합시키고자 원할 경우에""는 <literal>merge()</literal>를 사용하라. 달리 말해, 당신의 detached 인스턴스""들에 대한 재첨부가 실행되는 첫 번째 오퍼레이션임을 확실히 함으로써, ""<literal>update()</literal>는 대개 갓 만들어진 세션에서 당신이 호출하게 될 ""첫 번째 메소드이다."#. Tag: para#: session_api.xml:553#, no-c-formatmsgid """The application should individually <literal>update()</literal> detached ""instances reachable from the given detached instance if and <emphasis>only</""emphasis> if it wants their state also updated. This can be automated of ""course, using <emphasis>transitive persistence</emphasis>, see <xref linkend="
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -