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

📄 events.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
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 "Les intercepteurs et les événements"#. 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 """Il est souvent utile pour l'application de réagir à certains événements qui ""surviennent dans Hibernate. Cela autorise l'implémentation de certaines ""sortes de fonctionnalités génériques, et d'extensions de fonctionnalités ""d'Hibernate."#. Tag: title#: events.xml:14#, no-c-formatmsgid "Interceptors"msgstr "Intercepteurs"#. 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 """L'interface <literal>Interceptor</literal> fournit des \"callbacks\" de la ""session vers l'application et permettent à l'application de consulter et/ou ""de manipuler des propriétés d'un objet persistant avant qu'il soit ""sauvegardé, mis à jour, supprimé ou chargé. Une utilisation possible de ""cette fonctionnalité est de tracer l'accès à l'information. Par exemple, ""l'<literal>Interceptor</literal> suivant positionne ""<literal>createTimestamp</literal> quand un <literal>Auditable</literal> est ""créé et met à jour la propriété <literal>lastUpdateTimestamp</literal> quand ""un <literal>Auditable</literal> est mis à jour."#. Tag: para#: events.xml:27#, no-c-formatmsgid """You may either implement <literal>Interceptor</literal> directly or (better) ""extend <literal>EmptyInterceptor</literal>."msgstr """Vous pouvez soit implémenter <literal>Interceptor</literal> directement ou ""(mieux) étendre <literal>EmptyInterceptor</literal>."#. 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 """Interceptors come in two flavors: <literal>Session</literal>-scoped and ""<literal>SessionFactory</literal>-scoped."#. 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 """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>."#. 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 """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."#. 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 "Système d'événements"#. 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 """Si vous devez réagir à des événements particuliers dans votre couche de ""persistance, vous pouvez aussi utiliser l'architecture ""d'<emphasis>événements</emphasis> d'Hibernate3. Le système d'événements peut ""être utilisé en supplément ou en remplacement des interceptors."#. Tag: para#: events.xml:69#, no-c-formatmsgid """Essentially all of the methods of the <literal>Session</literal> interface "

⌨️ 快捷键说明

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