⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 performance.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgstr ""#. Tag: para#: performance.xml:313#, no-c-formatmsgid """where <literal>CatImpl</literal> implements the interface <literal>Cat</""literal> and <literal>DomesticCatImpl</literal> implements the interface ""<literal>DomesticCat</literal>. Then proxies for instances of <literal>Cat</""literal> and <literal>DomesticCat</literal> may be returned by <literal>load""()</literal> or <literal>iterate()</literal>. (Note that <literal>list()</""literal> does not usually return proxies.)"msgstr """여기서 <literal>CatImpl</literal>은 <literal>Cat</literal> 인터페이스를 구현""하고 <literal>DomesticCatImpl</literal>은 <literal>DomesticCat</literal> 인터""페이스를 구현한다. 그때 <literal>Cat</literal>과 <literal>DomesticCat</""literal>의 인스턴스들에 대한 프락시들은 <literal>load()</literal> 또는 ""<literal>iterate()</literal>에 의해 반환될 수 있다. (<literal>list()</""literal>가 대개 프락시들을 반환하지 않음을 노트하라.)"#. Tag: programlisting#: performance.xml:321#, no-c-formatmsgid """<![CDATA[Cat cat = (Cat) session.load(CatImpl.class, catid);\n""Iterator iter = session.createQuery(\"from CatImpl as cat where cat.""name='fritz'\").iterate();\n""Cat fritz = (Cat) iter.next();]]>"msgstr ""#. Tag: para#: performance.xml:323#, no-c-formatmsgid """Relationships are also lazily initialized. This means you must declare any ""properties to be of type <literal>Cat</literal>, not <literal>CatImpl</""literal>."msgstr """관계들은 또한 lazy 초기화 된다. 이것은 당신이 임의의 프로퍼티들을 ""<literal>CatImpl</literal> 타입이 아닌 <literal>Cat</literal> 타입으로 선언해""야 함을 의미한다."#. Tag: para#: performance.xml:328#, no-c-formatmsgid """Certain operations do <emphasis>not</emphasis> require proxy initialization"msgstr """어떤 오퍼레이션들은 프락시 초기화를 필요로 하지 <emphasis>않는다</emphasis>"#. Tag: para#: performance.xml:334#, no-c-formatmsgid """<literal>equals()</literal>, if the persistent class does not override ""<literal>equals()</literal>"msgstr """<literal>equals()</literal>, 만일 영속 클래스가 <literal>equals()</literal>""를 오버라이드 시키지 않는 경우"#. Tag: para#: performance.xml:340#, no-c-formatmsgid """<literal>hashCode()</literal>, if the persistent class does not override ""<literal>hashCode()</literal>"msgstr """<literal>hashCode()</literal>, 만일 영속 클래스가<literal>hashCode()</""literal>를 오버라이드 시키지 않는 경우"#. Tag: para#: performance.xml:346#, no-c-formatmsgid "The identifier getter method"msgstr "식별자 getter 메소드"#. Tag: para#: performance.xml:352#, no-c-formatmsgid """Hibernate will detect persistent classes that override <literal>equals()</""literal> or <literal>hashCode()</literal>."msgstr """Hibernate는 <literal>equals()</literal> 또는 <literal>hashCode()</literal>를 ""오버라이드 시키는 영속 클래스들을 검출할 것이다."#. Tag: para#: performance.xml:357#, no-c-formatmsgid """By choosing <literal>lazy=\"no-proxy\"</literal> instead of the default ""<literal>lazy=\"proxy\"</literal>, we can avoid the problems associated with ""typecasting. However, we will require buildtime bytecode instrumentation, ""and all operations will result in immediate proxy initialization."msgstr """디폴트 <literal>lazy=\"proxy\"</literal> 대신에 <literal>lazy=\"no-proxy\"</""literal>를 선택하여, 우리는 타입캐스팅과 연관된 문제점들을 피할 수 있다. 하지""만 우리는 빌드 시 바이트코드 수단을 필요로 할 것이고, 모든 연산들은 즉각적인 ""프락시 초기화로 귀결될 것이다."#. Tag: title#: performance.xml:367#, no-c-formatmsgid "Initializing collections and proxies"msgstr "콜렉션들과 프락시들을 초기화 시키기"#. Tag: para#: performance.xml:369#, no-c-formatmsgid """A <literal>LazyInitializationException</literal> will be thrown by Hibernate ""if an uninitialized collection or proxy is accessed outside of the scope of ""the <literal>Session</literal>, ie. when the entity owning the collection or ""having the reference to the proxy is in the detached state."msgstr """만일 초기화 되지 않은 콜렉션이나 프락시가 <literal>Session</literal> 영역의 ""외부에서 접근될 경우에, 예를 들어 콜렉션을 소유하거나 프락시에 대한 참조를 가""진 엔티티가 detached 상태에 있을 때, <literal>LazyInitializationException</""literal>이 Hibernate에 의해 던져질 것이다."#. Tag: para#: performance.xml:375#, no-c-formatmsgid """Sometimes we need to ensure that a proxy or collection is initialized before ""closing the <literal>Session</literal>. Of course, we can alway force ""initialization by calling <literal>cat.getSex()</literal> or <literal>cat.""getKittens().size()</literal>, for example. But that is confusing to readers ""of the code and is not convenient for generic code."msgstr """때때로 우리는<literal>Session</literal>을 닫기 전에 프락시 또는 콜렉션이 초기""화 됨을 확실히 할 필요가 있다. 물론 우리는 예를 들어 <literal>cat.getSex()</""literal> 또는 <literal>cat.getKittens().size()</literal>를 호출하여 항상 초기""화를 강제시킬 수 있다. 그러나 그것은 코드의 독자들에게는 혼동스럽고 일반적인 ""코드로 편의적이지 않다."#. Tag: para#: performance.xml:382#, no-c-formatmsgid """The static methods <literal>Hibernate.initialize()</literal> and ""<literal>Hibernate.isInitialized()</literal> provide the application with a ""convenient way of working with lazily initialized collections or proxies. ""<literal>Hibernate.initialize(cat)</literal> will force the initialization ""of a proxy, <literal>cat</literal>, as long as its <literal>Session</""literal> is still open. <literal>Hibernate.initialize( cat.getKittens() )</""literal> has a similar effect for the collection of kittens."msgstr """static 메소드들 <literal>Hibernate.initialize()</literal>와 ""<literal>Hibernate.isInitialized()</literal>는 lazy 초기화 된 콜렉션들이나 프""락시들에 대해 작업하는 편리한 방법을 어플리케이션에 제공한다. ""<literal>Hibernate.initialize(cat)</literal>은 그것의 <literal>Session</""literal>이 여전히 열려져 있는 한 프락시 <literal>cat</literal>의 초기화를 강""제할 것이다. <literal>Hibernate.initialize( cat.getKittens())</literal>는 ""kittens의 콜렉션에 대해 유사한 효과를 갖는다."#. Tag: para#: performance.xml:391#, no-c-formatmsgid """Another option is to keep the <literal>Session</literal> open until all ""needed collections and proxies have been loaded. In some application ""architectures, particularly where the code that accesses data using ""Hibernate, and the code that uses it are in different application layers or ""different physical processes, it can be a problem to ensure that the ""<literal>Session</literal> is open when a collection is initialized. There ""are two basic ways to deal with this issue:"msgstr """또 다른 옵션은 모든 필요한 콜렉션들과 프락시들이 로드되기 전까지 ""<literal>Session</literal>을 열린 채로 유지하는 것이다. 몇몇 어플리케이션 아""키텍처들, 특히 Hibernate를 사용하여 데이터에 접근하는 코드, 그리고 다른 어플""리케이션 계층들이나 다른 물리적 프로세스들 내에서 그것을 사용하는 코드에서, ""그것은 콜렉션이 초기화 될 때 <literal>Session</literal>이 열려져 있음을 확실""히 하는 문제일 수 있다. 이 쟁점을 다루는 두 가지 기본 방법들이 존재한다:"#. Tag: para#: performance.xml:402#, no-c-formatmsgid """In a web-based application, a servlet filter can be used to close the ""<literal>Session</literal> only at the very end of a user request, once the ""rendering of the view is complete (the <emphasis>Open Session in View</""emphasis> pattern). Of course, this places heavy demands on the correctness ""of the exception handling of your application infrastructure. It is vitally ""important that the <literal>Session</literal> is closed and the transaction ""ended before returning to the user, even when an exception occurs during ""rendering of the view. See the Hibernate Wiki for examples of this \"Open ""Session in View\" pattern."msgstr """웹 기반 어플리케이션에서, 서블릿 필터는 뷰 렌더링이 완료되는, 사용자 요청의 ""바로 끝에서만 <literal>Session</literal>을 닫는데 사용될 수 있다""(<emphasis>Open Session in View</emphasis> 패턴). 물론 이것은 당신의 어플리케""이션 인프라스트럭처의 예외상황 처리의 정정에 관한 무거운 요구를 부과한다. 뷰 ""렌더링 동안에 하나의 예외상황이 발생할때에도 사용자에게 반환되기 전에 ""<literal>Session</literal>이 닫혀지고 트랜잭션이 종료되는 것은 지극히 중요하""다. 이 \"Open Session in View\" 패턴에 관한 예제들은 Hibernate 위키를 보라."#. Tag: para#: performance.xml:415#, no-c-formatmsgid """In an application with a separate business tier, the business logic must ""\"prepare\" all collections that will be needed by the web tier before ""returning. This means that the business tier should load all the data and ""return all the data already initialized to the presentation/web tier that is ""required for a particular use case. Usually, the application calls ""<literal>Hibernate.initialize()</literal> for each collection that will be ""needed in the web tier (this call must occur before the session is closed) ""or retrieves the collection eagerly using a Hibernate query with a ""<literal>FETCH</literal> clause or a <literal>FetchMode.JOIN</literal> in ""<literal>Criteria</literal>. This is usually easier if you adopt the ""<emphasis>Command</emphasis> pattern instead of a <emphasis>Session Facade</""emphasis>."msgstr """별도의 비지니스 티어를 가진 어플리케이션에서, 비지니스 로직은 반환 전에 웹 티""어에 필요한 모든 콜렉션들을 \"준비\"해야 한다. 이것은 비지니스 티어가 모든 데""이터를 로드시키고 이미 초기화된 모든 데이터를 특정 쓰임새에 필요한 프리젠테이""션/웹 티어로 반환해야 함을 의미한다. 대개 어플리케이션은 웹 티어에 필요하게 ""될 각각의 콜렉션에 대해 <literal>Hibernate.initialize()</literal>를 호출하거""나(이 호출은 세션이 닫히기 전에 발생해야 한다) 또는 <literal>FETCH</literal> ""절을 갖거나 또는 <literal>Criteria</literal> 내에 <literal>FetchMode.JOIN</""literal>을 가진 Hibernate 질의를 사용하여 콜렉션을 열심히 검색한다. 이것은 대""개 당신이 <emphasis>Session Facade</emphasis> 대신 <emphasis>Command</""emphasis> 패턴을 채택할 경우에 더 쉽다."#. Tag: para#: performance.xml:430#, no-c-formatmsgid """You may also attach a previously loaded object to a new <literal>Session</""literal> with <literal>merge()</literal> or <literal>lock()</literal> before ""accessing uninitialized collections (or other proxies). No, Hibernate does ""not, and certainly <emphasis>should</emphasis> not do this automatically, ""since it would introduce ad hoc transaction semantics!"msgstr """당신은 또한 초기화 되지 않은 콜렉션들(또는 다른 프락시들)에 접근하기 전에 ""<literal>merge()</literal> 또는 <literal>lock()</literal>으로 앞서 로드된 객""체를 새로운 <literal>Session</literal>n에 첨부할 수도 있다. 아니다. Hibernate""는 이것을 자동적으로 행하지 않고, 확실히 자동적으로 행하지 <emphasis>않을 것""이다</emphasis>. 왜냐하면 그것은 특별한 목적을 위한 트랜잭션 의미를 도입할 것""이기 때문이다!"#. Tag: para#: performance.xml:440#, no-c-formatmsgid """Sometimes you don't want to initialize a large collection, but still need ""some information about it (like its size) or a subset of the data."msgstr """때때로 당신은 거대한 콜렉션을 초기화 시키는 것을 원하지 않지만, 여전히 (그것""의 사이즈와 같은) 그것에 대한 어떤 정보 또는 데이터의 부분집합을 필요로 한다."#. Tag: para#: performance.xml:445#, no-c-formatmsgid """You can use a collection filter to get the size of a collection without ""initializing it:"msgstr """당신은 그것을 초기화 시키지 않고서 콜렉션의 사이즈를 얻는데 콜렉션 필터를 사""용할 수 있다:"#. Tag: programlisting#: performance.xml:449#, no-c-formatmsgid """<![CDATA[( (Integer) s.createFilter( collection, \"select count(*)\" ).list""().get(0) ).intValue()]]>"msgstr ""#. Tag: para#: performance.xml:451#, no-c-formatmsgid """The <literal>createFilter()</literal> method is also used to efficiently ""retrieve subsets of a collection without needing to initialize the whole ""collection:"msgstr """<literal>createFilter()</literal> 메소드는 또한 전체 콜렉션을 초기화 시킬 필""요 없이 콜렉션의 부분집합들을 효율적으로 검색하는데 사용된다:"#. Tag: programlisting#: performance.xml:456#, no-c-formatmsgid """<![CDATA[s.createFilter( lazyCollection, \"\").setFirstResult(0).""setMaxResults(10).list();]]>"msgstr ""#. Tag: title#: performance.xml:461#, no-c-formatmsgid "Using batch fetching"msgstr "batch 페칭 사용하기"#. Tag: para#: performance.xml:463#, no-c-formatmsgid """Hibernate can make efficient use of batch fetching, that is, Hibernate can ""load several uninitialized proxies if one proxy is accessed (or collections. ""Batch fetching is an optimization of the lazy select fetching strategy. ""There are two ways you can tune batch fetching: on the class and the ""collection level."msgstr """Hibernate는 배치 페칭을 효율적으로 사용할 수 있다. 즉 하나의 프락시가 액세스 ""될 경우에 Hibernate는 몇몇 초기화 되지 않은 프락시들을 로드시킬 수 있다(또는 ""콜렉션들). batch 페칭은 lazy select 페칭 방도에 대한 최적화이다. 당신이 ""batch 페칭을 튜닝시킬 수 있는 두 가지 방법들이 존재한다: 클래스 레벨에서 그리""고 콜렉션 레벨에서."#. Tag: para#: performance.xml:469#, no-c-formatmsgid ""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -