alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (events.po)

This example Hibernate source code file (events.po) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

a, auditable, auditinterceptor, cdata, cdata, hibernate, hibernate, object, object, serializable, string, tag, tag, type

The Hibernate events.po source code

# translation of events.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2006.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# , 2007.
# Michael H. Smith <mhideo@redhat.com>, 2007.
# Glaucia Cintra <gcintra@redhat.com>, 2007.
msgid ""
msgstr ""
"Project-Id-Version: events\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-10T07:25:34\n"
"PO-Revision-Date: 2009-10-28 16:51+1000\n"
"Last-Translator: \n"
"Language-Team:  <en@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.11.4\n"

#. Tag: title
#, no-c-format
msgid "Interceptors and events"
msgstr "Interceptadores e Eventos"

#. Tag: para
#, no-c-format
msgid ""
"It is useful for the application to react to certain events that occur "
"inside Hibernate. This allows for the implementation of generic "
"functionality and the extension of Hibernate functionality."
msgstr ""
"É muito útil quando a aplicação precisa reagir a certos eventos que ocorrem "
"dentro do Hibernate. Isso permite a implementação de certas funções "
"genéricas, assim como permite estender as funcionalidades do Hibernate."

#. Tag: title
#, no-c-format
msgid "Interceptors"
msgstr "Interceptadores"

#. Tag: para
#, no-c-format
msgid ""
"The <literal>Interceptor 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 "
"automatically sets the <literal>createTimestamp when an "
"<literal>Auditable is created and updates the "
"<literal>lastUpdateTimestamp property when an Auditable permite fornecer informações da "
"sessão para o aplicativo, permitindo que o aplicativo inspecione e/ou "
"manipule as propriedades de um objeto persistente antes de ser salvo, "
"atualizado, excluído ou salvo. Pode ser usado para gerar informações de "
"auditoria. Por exemplo, o seguinte <literal>Interceptor ajusta a "
"função automaticamente <literal>createTimestamp quando um "
"<literal>Auditable é criado e atualiza a função "
"<literal>lastUpdateTimestamp quando um Auditable directly or extend "
"<literal>EmptyInterceptor."
msgstr ""
"Você pode implementar <literal>Interceptor diretamente ou pode "
"estender <literal>EmptyInterceptor."

#. Tag: para
#, no-c-format
msgid ""
"There are two kinds of inteceptors: <literal>Session-scoped and "
"<literal>SessionFactory-scoped."
msgstr ""
"Os interceptadores se apresentam de duas formas: <literal>Session-"
"scoped e <literal>SessionFactory-scoped."

#. Tag: para
#, no-c-format
msgid ""
"A <literal>Session-scoped interceptor is specified when a session "
"is opened using one of the overloaded SessionFactory.openSession() methods "
"accepting an <literal>Interceptor."
msgstr ""
"Um interceptador delimitado da <literal>Session, é definido quando "
"uma sessão é aberta usando o método sobrecarregado da SessionFactory."
"openSession() que aceita um <literal>Interceptor como parâmetro."

#. Tag: para
#, no-c-format
msgid ""
"A <literal>SessionFactory-scoped interceptor is registered with "
"the <literal>Configuration object prior to building the "
"<literal>SessionFactory. Unless a session is opened explicitly "
"specifying the interceptor to use, the supplied interceptor will be applied "
"to all sessions opened from that <literal>SessionFactory. "
"<literal>SessionFactory-scoped interceptors must be thread safe. "
"Ensure that you do not store session-specific states, since multiple "
"sessions will use this interceptor potentially concurrently."
msgstr ""
"Um interceptador da <literal>SessionFactory-scoped é definido no "
"objeto <literal>Configuration antes da SessionFactory deve ser thread safe. Cetifique-se de não "
"armazenar funções de estado específicos da sessão, pois, provavelmente, "
"múltiplas sessões irão utilizar esse interceptador simultaneamente."

#. Tag: title
#, no-c-format
msgid "Event system"
msgstr "Sistema de Eventos"

#. Tag: para
#, no-c-format
msgid ""
"If you have to react to particular events in your persistence layer, you can "
"also use the Hibernate3 <emphasis>event architecture. The event "
"system can be used in addition, or as a replacement, for interceptors."
msgstr ""
"Se você precisar executar uma ação em determinados eventos da camada de "
"persistência, você também pode usar a arquitetura de <emphasis>event interface correlate to an "
"event. You have a <literal>LoadEvent, a FlushEventorg."
"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 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 is processed by "
"the registered implementation of the <literal>LoadEventListener "
"interface), in which case their implementation would be responsible for "
"processing any <literal>load() requests made of the "
"<literal>Session."
msgstr ""
"Essencialmente todos os métodos da interface <literal>Session "
"possuem um evento correlacionado. Se você tiver um <literal>LoadEventLoadEvent, etc. Consulte o DTD do XML de "
"arquivo deconfiguração ou o pacote <literal>org.hibernate.event "
"para a lista completa dos tipos de eventos). Quando uma requisição é feita "
"em um desses métodos, a <literal>Session do hibernate gera um "
"evento apropriado e o envia para o listener de evento correspondente àquele "
"tipo de evento. Esses listeners implementam a mesma lógica que aqueles "
"métodos, trazendo os mesmos resultados. Entretanto, você é livre para "
"implementar uma customização de um desses listeners (isto é, o "
"<literal>LoadEvent é processado pela implementação registrada da "
"interface <literal>LoadEventListener), então sua implementação vai "
"ficar responsável por processar qualquer requisição <literal>load()Session."

#. Tag: para
#, no-c-format
msgid ""
"The listeners should be considered singletons. This means they are shared "
"between requests, and should not save any state as instance variables."
msgstr ""
"Para todos os efeitos esses listeners devem ser considerados singletons. "
"Isto significa que eles são compartilhados entre as requisições, e assim "
"sendo, não devem salvar nenhum estado das variáveis instanciadas."

#. Tag: para
#, no-c-format
msgid ""
"A custom listener implements 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 "
"object, or specified in the Hibernate configuration XML. Declarative "
"configuration through the properties file is not supported. Here is an "
"example of a custom load event listener:"
msgstr ""
"Um listener personalizado deve implementar a interface referente ao evento a "
"ser processado e/ou deve estender a classes base equivalentes (ou mesmo os "
"listeners padrões usados pelo Hibernate, eles não são declarados como finais "
"com esse objetivo). O listener personalizado pode ser registrado "
"programaticamente no objeto <literal>Configuration, ou "
"declarativamente no XML de configuração do Hibernate especificado. A "
"configuração declarativa através do arquivo de propriedades não é suportado. "
"Aqui temos um exemplo de como carregar um listener personalizado:"

#. Tag: para
#, no-c-format
msgid ""
"You also need a configuration entry telling Hibernate to use the listener in "
"addition to the default listener:"
msgstr ""
"Você também precisa adicionar uma entrada no XML de configuração do "
"Hibernate para registrar declarativamente qual listener deve se utilizado em "
"conjunto com o listener padrão:"

#. Tag: para
#, no-c-format
msgid "Instead, you can register it programmatically:"
msgstr "Ou, você pode registrar o listener programaticamente:  "

#. Tag: para
#, no-c-format
msgid ""
"Listeners registered declaratively cannot share instances. If the same class "
"name is used in multiple <literal><listener/> elements, each "
"reference will result in a separate instance of that class. If you need to "
"share listener instances between listener types you must use the "
"programmatic registration approach."
msgstr ""
"Listeners registrados declarativamente não compartilham da mesma instância. "
"Se o mesmo nome da classe for utilizado em vários elementos <literal><"
"listener/></literal>, cada um resultará em uma instância separada dessa "
"classe. Se você tem a necessidade de compartilhar uma instância de um "
"listener entre diversos tipos de listeners você deve registrar o listener "
"programaticamente. "

#. Tag: para
#, no-c-format
msgid ""
"Why implement an interface and define the specific type during "
"configuration? 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 ""
"Mas, por quê implementar uma interface e definir o tipo específico durante a "
"configuração? Bem, um listener pode implementar vários listeners de evento. "
"Com o tipo sendo definido durante o registro, fica fácil ligar ou desligar "
"listeners personalizados durante a configuração. "

#. Tag: title
#, no-c-format
msgid "Hibernate declarative security"
msgstr "Segurança declarativa do Hibernate"

#. Tag: para
#, no-c-format
msgid ""
"Usually, declarative security in Hibernate applications is managed in a "
"session facade layer. Hibernate3 allows certain actions to be permissioned "
"via JACC, and authorized via JAAS. This is an optional functionality that is "
"built on top of the event architecture."
msgstr ""
"Geralmente a segurança declarativa nos aplicativos do Hibernate é gerenciada "
"em uma camada de fachada de sessão. Agora o Hibernate3 permite certas ações "
"serem aceitas através do JACC e autorizadas através do JAAS. Esta é uma "
"funcionalidade opcional construída em cima da arquitetura do evento. "

#. Tag: para
#, no-c-format
msgid ""
"First, you must configure the appropriate event listeners, to enable the use "
"of JAAS authorization."
msgstr ""
"Primeiro, você precisa configurar um evento listener apropriado, para "
"possibilitar o uso da autorização JAAS."

#. Tag: para
#, no-c-format
msgid ""
"Note that <literal><listener type=\"...\" class=\"...\"/> is "
"shorthand for <literal><event type=\"...\"><listener class=\"...\"/"
"></event></literal> when there is exactly one listener for a "
"particular event type."
msgstr ""
"Note que <literal><listener type=\"...\" class=\"...\"/> é "
"somente um atalho para <literal><event type=\"...\"><listener class="
"\"...\"/></event></literal> quando existir somente um listener para "
"um tipo de evento em particular."

#. Tag: para
#, no-c-format
msgid ""
"Next, while still in <literal>hibernate.cfg.xml, bind the "
"permissions to roles:"
msgstr ""
"Depois disso, ainda em <literal>hibernate.cfg.xml, vincule as "
"permissões aos papéis:"

#. Tag: para
#, no-c-format
msgid "The role names are the roles understood by your JACC provider."
msgstr "Os nomes das funções são as funções conhecidas pelo seu provedor JACC."

#~ msgid ""
#~ "<![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 ""
#~ "<![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"
#~ "}]]>"

#~ msgid ""
#~ "<![CDATA[Session session = sf.openSession( new AuditInterceptor() );]]>"
#~ msgstr ""
#~ "<![CDATA[Session session = sf.openSession( new AuditInterceptor() );]]>"

#~ msgid ""
#~ "<![CDATA[new Configuration().setInterceptor( new AuditInterceptor() );]]>"
#~ msgstr ""
#~ "<![CDATA[new Configuration().setInterceptor( new AuditInterceptor() );]]>"

#~ msgid ""
#~ "<![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 ""
#~ "<![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"
#~ "}]]>"

#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["

#~ msgid ""
#~ "<![CDATA[Configuration cfg = new Configuration();\n"
#~ "LoadEventListener[] stack = { new MyLoadListener(), new "
#~ "DefaultLoadEventListener() };\n"
#~ "cfg.EventListeners().setLoadEventListeners(stack);]]>"
#~ msgstr ""
#~ "<![CDATA[Configuration cfg = new Configuration();\n"
#~ "LoadEventListener[] stack = { new MyLoadListener(), new "
#~ "DefaultLoadEventListener() };\n"
#~ "cfg.EventListeners().setLoadEventListeners(stack);]]>"

#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["

#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate events.po source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.