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

📄 events.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
#: events.xml:69#, no-c-formatmsgid """Essentially all of the methods of the <literal>Session</literal> interface ""correlate to an event. You have a <literal>LoadEvent</literal>, a ""<literal>FlushEvent</literal>, etc (consult the XML configuration-file DTD ""or the <literal>org.hibernate.event</literal> package for the full list of ""defined event types). When a request is made of one of these methods, the ""Hibernate <literal>Session</literal> generates an appropriate event and ""passes it to the configured event listeners for that type. Out-of-the-box, ""these listeners implement the same processing in which those methods always ""resulted. However, you are free to implement a customization of one of the ""listener interfaces (i.e., the <literal>LoadEvent</literal> is processed by ""the registered implemenation of the <literal>LoadEventListener</literal> ""interface), in which case their implementation would be responsible for ""processing any <literal>load()</literal> requests made of the ""<literal>Session</literal>."msgstr """本質的に <literal>Session</literal> インターフェイスのすべてのメソッドは、 1""個のイベントと相互に関連します。 例えば <literal>LoadEvent</literal>、""<literal>FlushEvent</literal> などがあります (定義済みのイベント型の一覧につ""いては、XML設定ファイルのDTDや <literal>org.hibernate.event</literal> パッ""ケージを調べてください)。 リクエストがこれらのメソッドの1つから作られると""き、 Hibernateの <literal>Session</literal> は適切なイベントを生成し、 そのイ""ベント型に設定されたイベントリスナに渡します。 すばらしいことに、これらのリス""ナはそのメソッドと同じ処理を実装します。 とはいえ、リスナインターフェイスの一""つを自由にカスタム実装できます (つまり、<literal>LoadEvent</literal> は登録""された <literal>LoadEventListener</literal> インターフェイスの実装により処理""されます)。 その場合、その実装には <literal>Session</literal> から作られたど""のような <literal>load()</literal> リクエストをも処理する責任があります。"#. Tag: para#: events.xml:84#, no-c-formatmsgid """The listeners should be considered effectively singletons; meaning, they are ""shared between requests, and thus should not save any state as instance ""variables."msgstr """リスナは事実上シングルトンであると見なせます。 つまりリスナはリクエスト間で共""有されるため、 インスタンス変数として状態を保持するべきではないということで""す。"#. Tag: para#: events.xml:89#, no-c-formatmsgid """A custom listener should implement the appropriate interface for the event ""it wants to process and/or extend one of the convenience base classes (or ""even the default event listeners used by Hibernate out-of-the-box as these ""are declared non-final for this purpose). Custom listeners can either be ""registered programmatically through the <literal>Configuration</literal> ""object, or specified in the Hibernate configuration XML (declarative ""configuration through the properties file is not supported). Here's an ""example of a custom load event listener:"msgstr """カスタムリスナは処理したいイベントについて適切なインターフェイスを実装するべ""きです。 便利な基底クラスのうちの一つを継承してもよいです (またはHibernateが""デフォルトで使用するイベントリスナを継承してもよいです。 すばらしいことに、こ""の目的のために非finalとして宣言されています)。 カスタムリスナは ""<literal>Configuration</literal> オブジェクトを使ってプログラムから登録する""か、 HibernateのXML設定ファイルで指定できます (プロパティファイルで宣言的に""設定する方法はサポートされていません)。 カスタムロードイベントリスナの例を示""します。"#. Tag: programlisting#: events.xml:99#, no-c-formatmsgid """<![CDATA[public class MyLoadListener implements LoadEventListener {\n""    // this is the single method defined by the LoadEventListener interface\n""    public void onLoad(LoadEvent event, LoadEventListener.LoadType ""loadType)\n""            throws HibernateException {\n""        if ( !MySecurity.isAuthorized( event.getEntityClassName(), event.""getEntityId() ) ) {\n""            throw MySecurityException(\"Unauthorized access\");\n""        }\n""    }\n""}]]>"msgstr ""#. Tag: para#: events.xml:101#, no-c-formatmsgid """You also need a configuration entry telling Hibernate to use the listener in ""addition to the default listener:"msgstr "デフォルトリスナ以外のリスナを使うには、Hibernateへの設定も必要です:"#. Tag: programlisting#: events.xml:106#, no-c-formatmsgid """<![CDATA[<hibernate-configuration>\n""    <session-factory>\n""        ...\n""        <event type=\"load\">\n""            <listener class=\"com.eg.MyLoadListener\"/>\n""            <listener class=\"org.hibernate.event.def.""DefaultLoadEventListener\"/>\n""        </event>\n""    </session-factory>\n""</hibernate-configuration>]]>"msgstr ""#. Tag: para#: events.xml:108#, no-c-formatmsgid "Instead, you may register it programmatically:"msgstr "またその他に、プログラムで登録する方法もあります:"#. Tag: programlisting#: events.xml:112#, no-c-formatmsgid """<![CDATA[Configuration cfg = new Configuration();\n""LoadEventListener[] stack = { new MyLoadListener(), new ""DefaultLoadEventListener() };\n""cfg.EventListeners().setLoadEventListeners(stack);]]>"msgstr ""#. Tag: para#: events.xml:114#, no-c-formatmsgid """Listeners registered declaratively cannot share instances. If the same class ""name is used in multiple <literal>&lt;listener/&gt;</literal> elements, each ""reference will result in a separate instance of that class. If you need the ""capability to share listener instances between listener types you must use ""the programmatic registration approach."msgstr """リスナを宣言的に登録すると、そのリスナのインスタンスを共有できません。 複数""の <literal>&lt;listener/&gt;</literal> 要素で同じクラス名が使われると、 それ""ぞれの参照はそのクラスの別々のインスタンスを指すことになります。 リスナ型の間""でリスナインスタンスを共有する必要があれば、 プログラムで登録する方法を採らな""ければなりません。"#. Tag: para#: events.xml:122#, no-c-formatmsgid """Why implement an interface and define the specific type during ""configuration? Well, a listener implementation could implement multiple ""event listener interfaces. Having the type additionally defined during ""registration makes it easier to turn custom listeners on or off during ""configuration."msgstr """なぜインターフェイスを実装して、特化した型を設定時に指定するのでしょうか? リ""スナの実装クラスに、複数のイベントリスナインターフェイスを実装できるからで""す。 登録時に追加で型を指定することで、カスタムリスナのon/offを設定時に簡単に""切り替えられます。"#. Tag: title#: events.xml:132#, no-c-formatmsgid "Hibernate declarative security"msgstr "Hibernateの宣言的なセキュリティ"#. Tag: para#: events.xml:133#, no-c-formatmsgid """Usually, declarative security in Hibernate applications is managed in a ""session facade layer. Now, Hibernate3 allows certain actions to be ""permissioned via JACC, and authorized via JAAS. This is optional ""functionality built on top of the event architecture."msgstr """一般的にHibernateアプリケーションの宣言的なセキュリティは、セッションファサー""ド層で管理します。 現在、Hiberenate3はJACCで許可しかつ、JAASで認証したアク""ションを許しています。 これはイベントアーキテクチャの最上位に組み込まれている""オプションの機能です。"#. Tag: para#: events.xml:139#, no-c-formatmsgid """First, you must configure the appropriate event listeners, to enable the use ""of JAAS authorization."msgstr """まず最初に、適切なイベントリスナを設定してJAAS認証を使えるようにしなければな""りません。"#. Tag: programlisting#: events.xml:144#, no-c-formatmsgid """<![CDATA[<listener type=\"pre-delete\" class=\"org.hibernate.secure.""JACCPreDeleteEventListener\"/>\n""<listener type=\"pre-update\" class=\"org.hibernate.secure.""JACCPreUpdateEventListener\"/>\n""<listener type=\"pre-insert\" class=\"org.hibernate.secure.""JACCPreInsertEventListener\"/>\n""<listener type=\"pre-load\" class=\"org.hibernate.secure.""JACCPreLoadEventListener\"/>]]>"msgstr ""#. Tag: para#: events.xml:146#, no-c-formatmsgid """Note that <literal>&lt;listener type=\"...\" class=\"...\"/&gt;</literal> is ""just a shorthand for <literal>&lt;event type=\"...\"&gt;&lt;listener class=""\"...\"/&gt;&lt;/event&gt;</literal> when there is exactly one listener for ""a particular event type."msgstr """特定のイベント型に対してちょうど一つのリスナがあるとき、 <literal>&lt;""listener type=\"...\" class=\"...\"/&gt;</literal> は <literal>&lt;event ""type=\"...\"&gt;&lt;listener class=\"...\"/&gt;&lt;/event&gt;</literal> の簡""略形に過ぎないことに注意してください。"#. Tag: para#: events.xml:152#, no-c-formatmsgid """Next, still in <literal>hibernate.cfg.xml</literal>, bind the permissions to ""roles:"msgstr """次に、同じく <literal>hibernate.cfg.xml</literal> でロールにパーミッションを""与えてください:"#. Tag: programlisting#: events.xml:156#, no-c-formatmsgid """<![CDATA[<grant role=\"admin\" entity-name=\"User\" actions=\"insert,update,""read\"/>\n""<grant role=\"su\" entity-name=\"User\" actions=\"*\"/>]]>"msgstr ""#. Tag: para#: events.xml:158#, no-c-formatmsgid "The role names are the roles understood by your JACC provider."msgstr "このロール名は使用するJACCプロバイダに理解されるロールです。"

⌨️ 快捷键说明

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