📄 events.po
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 07:47+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: events.xml:5#, no-c-formatmsgid "Interceptors and events"msgstr "인터셉터들과 이벤트들"#. Tag: para#: events.xml:7#, no-c-formatmsgid """It is often useful for the application to react to certain events that occur ""inside Hibernate. This allows implementation of certain kinds of generic ""functionality, and extension of Hibernate functionality."msgstr """어플리케이션이 Hibernate 내부에서 발생하는 어떤 이벤트들에 대해 반응하는 것""에 흔히 유용하다. 이것은 어떤 종류의 일반적인 기능, 그리고 Hibernate의 확장 ""기능의 구현을 허용해준다."#. Tag: title#: events.xml:14#, no-c-formatmsgid "Interceptors"msgstr "인터셉터들"#. Tag: para#: events.xml:16#, no-c-formatmsgid """The <literal>Interceptor</literal> interface provides callbacks from the ""session to the application allowing the application to inspect and/or ""manipulate properties of a persistent object before it is saved, updated, ""deleted or loaded. One possible use for this is to track auditing ""information. For example, the following <literal>Interceptor</literal> ""automatically sets the <literal>createTimestamp</literal> when an ""<literal>Auditable</literal> is created and updates the ""<literal>lastUpdateTimestamp</literal> property when an <literal>Auditable</""literal> is updated."msgstr """<literal>Interceptor</literal> 인터페이스는 영속 객체가 저장되고, 업데이트되""고, 삭제되거나 로드되기 전에 영속 객체의 프로퍼티들을 조사하고/하거나 처리하""는 것을 어플리케이션에 허용해줌으로써 세션으로부터 어플리케이션으로의 콜백들""을 제공한다. 이것에 대한 한 가지 가능한 사용은 감사 정보를 추적하는 것이다. ""예를 들어, 다음 <literal>Interceptor</literal>는 <literal>Auditable</literal>""이 생성될 때 <literal>createTimestamp</literal>를 자동적으로 설정하고 ""<literal>Auditable</literal>이 업데이트될 때 <literal>lastUpdateTimestamp</""literal> 프로퍼티를 업데이트 한다."#. Tag: para#: events.xml:27#, no-c-formatmsgid """You may either implement <literal>Interceptor</literal> directly or (better) ""extend <literal>EmptyInterceptor</literal>."msgstr """당신은 <literal>Interceptor</literal>를 직접 구현해야 하거나 (더 좋게는) ""<literal>EmptyInterceptor</literal>를 확장(extend)해야 한다."#. Tag: programlisting#: events.xml:32#, no-c-formatmsgid """<![CDATA[package org.hibernate.test;\n""\n""import java.io.Serializable;\n""import java.util.Date;\n""import java.util.Iterator;\n""\n""import org.hibernate.EmptyInterceptor;\n""import org.hibernate.Transaction;\n""import org.hibernate.type.Type;\n""\n""public class AuditInterceptor extends EmptyInterceptor {\n""\n"" private int updates;\n"" private int creates;\n"" private int loads;\n""\n"" public void onDelete(Object entity,\n"" Serializable id,\n"" Object[] state,\n"" String[] propertyNames,\n"" Type[] types) {\n"" // do nothing\n"" }\n""\n"" public boolean onFlushDirty(Object entity,\n"" Serializable id,\n"" Object[] currentState,\n"" Object[] previousState,\n"" String[] propertyNames,\n"" Type[] types) {\n""\n"" if ( entity instanceof Auditable ) {\n"" updates++;\n"" for ( int i=0; i < propertyNames.length; i++ ) {\n"" if ( \"lastUpdateTimestamp\".equals( propertyNames[i] ) ) {\n"" currentState[i] = new Date();\n"" return true;\n"" }\n"" }\n"" }\n"" return false;\n"" }\n""\n"" public boolean onLoad(Object entity,\n"" Serializable id,\n"" Object[] state,\n"" String[] propertyNames,\n"" Type[] types) {\n"" if ( entity instanceof Auditable ) {\n"" loads++;\n"" }\n"" return false;\n"" }\n""\n"" public boolean onSave(Object entity,\n"" Serializable id,\n"" Object[] state,\n"" String[] propertyNames,\n"" Type[] types) {\n""\n"" if ( entity instanceof Auditable ) {\n"" creates++;\n"" for ( int i=0; i<propertyNames.length; i++ ) {\n"" if ( \"createTimestamp\".equals( propertyNames[i] ) ) {\n"" state[i] = new Date();\n"" return true;\n"" }\n"" }\n"" }\n"" return false;\n"" }\n""\n"" public void afterTransactionCompletion(Transaction tx) {\n"" if ( tx.wasCommitted() ) {\n"" System.out.println(\"Creations: \" + creates + \", Updates: \" + ""updates, \"Loads: \" + loads);\n"" }\n"" updates=0;\n"" creates=0;\n"" loads=0;\n"" }\n""\n""}]]>"msgstr ""#. Tag: para#: events.xml:34#, no-c-formatmsgid """Interceptors come in two flavors: <literal>Session</literal>-scoped and ""<literal>SessionFactory</literal>-scoped."msgstr """인터셉터들은 다음 두 개의 특징들로 나타난다: <literal>Session</literal>-영역""화 그리고 <literal>SessionFactory</literal>-영역화."#. Tag: para#: events.xml:39#, no-c-formatmsgid """A <literal>Session</literal>-scoped interceptor is specified when a session ""is opened using one of the overloaded SessionFactory.openSession() methods ""accepting an <literal>Interceptor</literal>."msgstr """<literal>Session</literal>-영역의 인터셉터는 세션이 하나의 ""<literal>Interceptor</literal>를 수용하는 오버로드된 SessionFactory.""openSession() 메소드들 중 하나를 사용하여 열릴 때 지정된다."#. Tag: programlisting#: events.xml:45#, no-c-formatmsgid "<![CDATA[Session session = sf.openSession( new AuditInterceptor() );]]>"msgstr ""#. Tag: para#: events.xml:47#, no-c-formatmsgid """A <literal>SessionFactory</literal>-scoped interceptor is registered with ""the <literal>Configuration</literal> object prior to building the ""<literal>SessionFactory</literal>. In this case, the supplied interceptor ""will be applied to all sessions opened from that <literal>SessionFactory</""literal>; this is true unless a session is opened explicitly specifying the ""interceptor to use. <literal>SessionFactory</literal>-scoped interceptors ""must be thread safe, taking care to not store session-specific state since ""multiple sessions will use this interceptor (potentially) concurrently."msgstr """<literal>SessionFactory</literal>-영역의 인터셉터는 <literal>SessionFactory</""literal>을 빌드하기에 앞서 <literal>Configuration</literal> 객체에 등록된다. ""이 경우에, 공급되는 인터셉터는 그 <literal>SessionFactory</literal>로부터 열""려진 모든 세션들에 적용될 것이다; 하나의 세션이 사용할 인터셉터를 명시적으로 ""지정하여 열리지 않는 한 이것은 참이다. <literal>SessionFactory</literal>-영역""의 인터셉터들은 세션-지정적인 상태를 저장하지 않도록 주의하여 쓰레드-안전해""야 한다. 왜냐하면 다중 세션들은 (잠정적으로) 이 인터셉터를 동시적으로 사용할 ""것이기 때문이다."#. Tag: programlisting#: events.xml:56#, no-c-formatmsgid """<![CDATA[new Configuration().setInterceptor( new AuditInterceptor() );]]>"msgstr ""#. Tag: title#: events.xml:61#, no-c-formatmsgid "Event system"msgstr "이벤트 시스템"#. Tag: para#: events.xml:63#, no-c-formatmsgid """If you have to react to particular events in your persistence layer, you may ""also use the Hibernate3 <emphasis>event</emphasis> architecture. The event ""system can be used in addition or as a replacement for interceptors."msgstr """만일 당신이 당신의 영속 계층에서 특정 이벤트들에 대해 반응해야 한다면, 당신""은 또한 Hibernate3 <emphasis>event</emphasis> 아키텍처를 사용할 수도 있다. 이""벤트 시스템은 부가물로 사용될 수 있거나 인터셉터들에 대한 대체물로 사용될 수 ""있다."#. Tag: para#: events.xml:69#, no-c-format
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -