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

Hibernate example source code file (persistent_classes.po)

This example Hibernate source code file (persistent_classes.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, a, cat, entitynameresolver, hibernate, hibernate, if, pojo, pojo, string, tag, tag, the, you

The Hibernate persistent_classes.po source code

# translation of persistent_classes.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: persistent_classes\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-07-20 21:02+0000\n"
"PO-Revision-Date: 2010-03-18 14:48+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
#: persistent_classes.xml:32
#, no-c-format
msgid "Persistent Classes"
msgstr "Classes Persistentes"

#. Tag: para
#: persistent_classes.xml:34
#, fuzzy, no-c-format
msgid ""
"Persistent classes are classes in an application that implement the entities "
"of the business problem (e.g. Customer and Order in an E-commerce "
"application). The term \"persistent\" here means that the classes are able "
"to be persisted, not that they are in the persistent state (see <xref "
"linkend=\"objectstate-overview\"/> for discussion)."
msgstr ""
"As classes persistentes são classes dentro de um aplicativo que implementa "
"as entidades de problemas de negócios (ex.: Cliente e Pedido em um "
"aplicativo e-commerce). Nem todas as instâncias de uma classe persistente "
"estão em estado persistente, uma instância pode, ao invés disso, ser "
"transiente ou desanexada. "

#. Tag: para
#: persistent_classes.xml:41
#, fuzzy, no-c-format
msgid ""
"Hibernate works best if these classes follow some simple rules, also known "
"as the Plain Old Java Object (POJO) programming model. However, none of "
"these rules are hard requirements. Indeed, Hibernate assumes very little "
"about the nature of your persistent objects. You can express a domain model "
"in other ways (using trees of <interfacename>java.util.Map "
"instances, for example)."
msgstr ""
"O Hibernate trabalha melhor se estas classes seguirem uma regra simples, "
"também conhecida como modelo de programação Objeto de Java Antigo Simples "
"(POJO). No entanto, nenhuma destas regras são difíceis solicitações. "
"Certamente, o Hibernate3 considera muito pouco da natureza de seus objetos "
"persistentes. Você pode expressar um modelo de domínio de outras formas (por "
"exemplo: utilizando árvores de instâncias <literal>Map)."

#. Tag: title
#: persistent_classes.xml:49
#, no-c-format
msgid "A simple POJO example"
msgstr "Um exemplo simples de POJO"

#. Tag: title
#: persistent_classes.xml:52
#, no-c-format
msgid "Simple POJO representing a cat"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:53
#, no-c-format
msgid ""
"package eg;\n"
"import java.util.Set;\n"
"import java.util.Date;\n"
"\n"
"public class Cat {\n"
"private Long id; // identifier\n"
"\n"
"private Date birthdate;\n"
"private Color color;\n"
"private char sex;\n"
"private float weight;\n"
"    private int litterId;\n"
"\n"
"    private Cat mother;\n"
"    private Set kittens = new HashSet();\n"
"\n"
"    private void setId(Long id) {\n"
"        this.id=id;\n"
"    }\n"
"    public Long getId() {\n"
"        return id;\n"
"    }\n"
"\n"
"    void setBirthdate(Date date) {\n"
"        birthdate = date;\n"
"    }\n"
"    public Date getBirthdate() {\n"
"        return birthdate;\n"
"    }\n"
"\n"
"    void setWeight(float weight) {\n"
"        this.weight = weight;\n"
"    }\n"
"    public float getWeight() {\n"
"        return weight;\n"
"    }\n"
"\n"
"    public Color getColor() {\n"
"        return color;\n"
"    }\n"
"    void setColor(Color color) {\n"
"        this.color = color;\n"
"    }\n"
"\n"
"    void setSex(char sex) {\n"
"        this.sex=sex;\n"
"    }\n"
"    public char getSex() {\n"
"        return sex;\n"
"    }\n"
"\n"
"    void setLitterId(int id) {\n"
"        this.litterId = id;\n"
"    }\n"
"    public int getLitterId() {\n"
"        return litterId;\n"
"    }\n"
"\n"
"    void setMother(Cat mother) {\n"
"        this.mother = mother;\n"
"    }\n"
"    public Cat getMother() {\n"
"        return mother;\n"
"    }\n"
"    void setKittens(Set kittens) {\n"
"        this.kittens = kittens;\n"
"    }\n"
"    public Set getKittens() {\n"
"        return kittens;\n"
"    }\n"
"\n"
"    // addKitten not needed by Hibernate\n"
"    public void addKitten(Cat kitten) {\n"
"        kitten.setMother(this);\n"
"    kitten.setLitterId( kittens.size() );\n"
"        kittens.add(kitten);\n"
"    }\n"
"}"
msgstr ""

#. Tag: para
#: persistent_classes.xml:57
#, no-c-format
msgid ""
"The four main rules of persistent classes are explored in more detail in the "
"following sections."
msgstr ""
"As quatro regras principais das classes persistentes são descritas em "
"maiores detalhes nas seguintes seções."

#. Tag: title
#: persistent_classes.xml:62
#, no-c-format
msgid "Implement a no-argument constructor"
msgstr "Implemente um construtor de não argumento"

#. Tag: para
#: persistent_classes.xml:64
#, fuzzy, no-c-format
msgid ""
"<classname>Cat has a no-argument constructor. All persistent "
"classes must have a default constructor (which can be non-public) so that "
"Hibernate can instantiate them using <literal>java.lang.reflect."
"Constructor</classname>.newInstance(). It is recommended that this "
"constructor be defined with at least <emphasis>package visibility "
"in order for runtime proxy generation to work properly."
msgstr ""
"<literal>Cat possui um construtor de não argumento. Todas as "
"classes persistentes devem ter um construtor padrão (que não pode ser "
"público), para que o Hibernate possa instanciá-lo utilizando um "
"<literal>Constructor.newInstance(). Nós recomendamos enfaticamente "
"ter um construtor padrão com ao menos uma visibilidade <emphasis>package has a property named id. This "
"property maps to the primary key column(s) of the underlying database table. "
"The type of the identifier property can be any \"basic\" type (see <xref "
"linkend=\"types.value.basic\"/>). See <xref linkend=\"components-compositeid"
"\"/> for information on mapping composite (multi-column) identifiers."
msgstr ""

#. Tag: para
#: persistent_classes.xml:92
#, no-c-format
msgid ""
"Identifiers do not necessarily need to identify column(s) in the database "
"physically defined as a primary key. They should just identify columns that "
"can be used to uniquely identify rows in the underlying table."
msgstr ""

#. Tag: para
#: persistent_classes.xml:99
#, no-c-format
msgid ""
"We recommend that you declare consistently-named identifier properties on "
"persistent classes and that you use a nullable (i.e., non-primitive) type."
msgstr ""
"Recomendamos que você declare propriedades de identificador nomeados de "
"forma consistente nas classes persistentes e que você use um tipo anulável "
"(ou seja, não primitivo)."

#. Tag: title
#: persistent_classes.xml:107
#, fuzzy, no-c-format
msgid "Prefer non-final classes (semi-optional)"
msgstr "Prefira classes não finais (opcional)"

#. Tag: para
#: persistent_classes.xml:109
#, no-c-format
msgid ""
"A central feature of Hibernate, <emphasis>proxies (lazy loading), "
"depends upon the persistent class being either non-final, or the "
"implementation of an interface that declares all public methods. You can "
"persist <literal>final classes that do not implement an interface "
"with Hibernate; you will not, however, be able to use proxies for lazy "
"association fetching which will ultimately limit your options for "
"performance tuning. To persist a <literal>final class which does "
"not implement a \"full\" interface you must disable proxy generation. See "
"<xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-xml\"/"
"> and <xref linkend=\"persistent-classes-pojo-final-example-disable-proxies-"
"ann\"/>."
msgstr ""

#. Tag: title
#: persistent_classes.xml:121
#, no-c-format
msgid "Disabling proxies in <literal>hbm.xml"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:122
#, no-c-format
msgid "<![CDATA[]]>"
msgstr ""

#. Tag: title
#: persistent_classes.xml:126
#, no-c-format
msgid "Disabling proxies in annotations"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:127
#, no-c-format
msgid "<![CDATA[@Entity @Proxy(lazy=false) public class Cat { ... }]]>"
msgstr ""

#. Tag: para
#: persistent_classes.xml:130
#, no-c-format
msgid ""
"If the <literal>final class does implement a proper interface, you "
"could alternatively tell Hibernate to use the interface instead when "
"generating the proxies. See <xref linkend=\"persistent-classes-pojo-final-"
"example-proxy-interface-xml\"/> and <xref linkend=\"persistent-classes-pojo-"
"final-example-proxy-interface-ann\"/>."
msgstr ""

#. Tag: title
#: persistent_classes.xml:139
#, no-c-format
msgid "Proxying an interface in <literal>hbm.xml"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:140
#, no-c-format
msgid "<![CDATA[]]>"
msgstr ""

#. Tag: title
#: persistent_classes.xml:144
#, no-c-format
msgid "Proxying an interface in annotations"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:145
#, no-c-format
msgid ""
"<![CDATA[@Entity @Proxy(proxyClass=ICat.class) public class Cat implements "
"ICat { ... }]]>"
msgstr ""

#. Tag: para
#: persistent_classes.xml:148
#, fuzzy, no-c-format
msgid ""
"You should also avoid declaring <literal>public final methods as "
"this will again limit the ability to generate <emphasis>proxies "
"from this class. If you want to use a class with <literal>public final em classes "
"não finais. Se você desejar usar uma classe com um método <literal>public "
"final</literal> você deve desabilitar o proxy explicitamente, ajustando "
"<literal>lazy=\"false\". "

#. Tag: title
#: persistent_classes.xml:158
#, no-c-format
msgid "Declare accessors and mutators for persistent fields (optional)"
msgstr "Declare acessores e mutadores para campos persistentes (opcional)"

#. Tag: para
#: persistent_classes.xml:160
#, fuzzy, no-c-format
msgid ""
"<classname>Cat declares accessor methods for all its persistent "
"fields. Many other ORM tools directly persist instance variables. It is "
"better to provide an indirection between the relational schema and internal "
"data structures of the class. By default, Hibernate persists JavaBeans style "
"properties and recognizes method names of the form <literal>getFooisFoo and setFoo. If "
"required, you can switch to direct field access for particular properties."
msgstr ""
"<literal>Cat declara os métodos assessores para todos os seus "
"campos persistentes. Muitas ferramentas ORM persistem diretamente variáveis "
"de instâncias. Acreditamos ser melhor prover uma indireção entre o esquema "
"relacional e as estruturas de dados internos da classe. Por padrão, o "
"Hibernate persiste as propriedades de estilo JavaBeans, e reconhece nomes de "
"métodos da forma <literal>getFoo, isFoo e "
"<literal>setFoo. Caso solicitado, você pode mudar para direcionar "
"acesso ao campo para certas propriedades, caso seja necessário. "

#. Tag: para
#: persistent_classes.xml:169
#, fuzzy, no-c-format
msgid ""
"Properties need <emphasis>not be declared public. Hibernate can "
"persist a property declared with <literal>package, "
"<literal>protected or private visibility as "
"well."
msgstr ""
"As propriedades precisam <emphasis>not ser declaradas como "
"públicas. O Hibernate pode persistir uma propriedade com um par get/set "
"padrão <literal>protegido ou privado."

#. Tag: title
#: persistent_classes.xml:178
#, no-c-format
msgid "Implementing inheritance"
msgstr "Implementando herança"

#. Tag: para
#: persistent_classes.xml:180
#, no-c-format
msgid ""
"A subclass must also observe the first and second rules. It inherits its "
"identifier property from the superclass, <literal>Cat. For example:"
msgstr ""
"Uma subclasse também deve observar as primeiras e segundas regras. Ela herda "
"sua propriedade de identificador a partir das superclasses, <literal>Cat and hashCode()"
msgstr ""
"Implementando <literal>equals() e hashCode() "

#. Tag: para
#: persistent_classes.xml:191
#, no-c-format
msgid ""
"You have to override the <literal>equals() and hashCode()"
"</literal> methods if you:"
msgstr ""
"Você precisa substituir os métodos <literal>equals() e "
"<literal>hashCode() se você:"

#. Tag: para
#: persistent_classes.xml:196
#, no-c-format
msgid ""
"intend to put instances of persistent classes in a <literal>Set "
"(the recommended way to represent many-valued associations); <emphasis>and"

#. Tag: para
#: persistent_classes.xml:202
#, no-c-format
msgid "intend to use reattachment of detached instances"
msgstr "pretender usar reconexão de instâncias desanexadas"

#. Tag: para
#: persistent_classes.xml:206
#, no-c-format
msgid ""
"Hibernate guarantees equivalence of persistent identity (database row) and "
"Java identity only inside a particular session scope. When you mix instances "
"retrieved in different sessions, you must implement <literal>equals()hashCode() if you wish to have meaningful "
"semantics for <literal>Sets."
msgstr ""
"O Hibernate garante a equivalência de identidades persistentes (linha de "
"base de dados) e identidade Java somente dentro de um certo escopo de "
"sessão. Dessa forma, assim que misturarmos instâncias recuperadas em sessões "
"diferentes, devemos implementar <literal>equals() e "
"<literal>hashCode() se quisermos ter semânticas significativas "
"para os <literal>Sets.  "

#. Tag: para
#: persistent_classes.xml:212
#, no-c-format
msgid ""
"The most obvious way is to implement <literal>equals()/"
"<literal>hashCode() by comparing the identifier value of both "
"objects. If the value is the same, both must be the same database row, "
"because they are equal. If both are added to a <literal>Set, you "
"will only have one element in the <literal>Set). Unfortunately, "
"you cannot use that approach with generated identifiers. Hibernate will only "
"assign identifier values to objects that are persistent; a newly created "
"instance will not have any identifier value. Furthermore, if an instance is "
"unsaved and currently in a <literal>Set, saving it will assign an "
"identifier value to the object. If <literal>equals() and "
"<literal>hashCode() are based on the identifier value, the hash "
"code would change, breaking the contract of the <literal>Set. See "
"the Hibernate website for a full discussion of this problem. This is not a "
"Hibernate issue, but normal Java semantics of object identity and equality."
msgstr ""
"A forma mais óbvia é implementar <literal>equals()/"
"<literal>hashCode() comparando o valor do identificador de ambos "
"objetos. Caso o valor seja o mesmo, ambos devem ter a mesma linha de base de "
"dados, assim eles serão iguais (se ambos forem adicionados a um "
"<literal>Set, nós só teremos um elemento no Set, salvá-la "
"atribuirá um valor de identificador ao objeto. Se <literal>equals()hashCode() fossem baseados em um valor "
"identificador, o código hash teria mudado, quebrando o contrato do "
"<literal>Set. Consulte o website do Hibernate para acessar uma "
"discussão completa sobre este problema. Note que esta não é uma edição do "
"Hibernate, e sim semânticas naturais do Java de igualdade e identidade."

#. Tag: para
#: persistent_classes.xml:228
#, no-c-format
msgid ""
"It is recommended that you implement <literal>equals() and "
"<literal>hashCode() using Business key equalityequals() "
"method compares only the properties that form the business key. It is a key "
"that would identify our instance in the real world (a <emphasis>natural e hashCode()Business key equality. A chave de "
"negócios significa que o método <literal>equals() compara somente "
"a propriedade que formar uma chave de negócios, uma chave que identificaria "
"nossa instância na realidade (uma chave de candidato <emphasis>naturals of Maps at runtime) "
"and the representation of entities as DOM4J trees. With this approach, you "
"do not write persistent classes, only mapping files."
msgstr ""
"Entidades persistentes não precisam ser representadas como classes POJO ou "
"como objetos JavaBeans em tempo de espera. O Hibernate também suporta "
"modelos dinâmicos (usando <literal>Maps de Maps "
"em tempo de execução) e a representação de entidades como árvores DOM4J. Com "
"esta abordagem, você não escreve classes persistes, somente arquivos de "
"mapeamentos. "

#. Tag: para
#: persistent_classes.xml:259
#, fuzzy, no-c-format
msgid ""
"By default, Hibernate works in normal POJO mode. You can set a default "
"entity representation mode for a particular <literal>SessionFactorydefault_entity_mode configuration "
"option (see <xref linkend=\"configuration-optional-properties\"/>)."
msgstr ""
"Por padrão, o Hibernate funciona em modo POJO normal. Você deve ajustar um "
"modo de representação de entidade por padrão para uma certa "
"<literal>SessionFactory usando a opção de configuração "
"<literal>default_entity_mode (veja entity-name has "
"to be declared instead of, or in addition to, a class name:"
msgstr ""
"Os seguintes exemplos demonstram a representação usando <literal>Mapentity-name for "
"the <literal>SessionFactory, you can, at runtime, work with "
"<literal>Maps of Maps:"
msgstr ""
"Após ajustar o modo de entidade padrão para <literal>dynamic-map "
"para a <literal>SessionFactory, você poderá trabalhar com "
"<literal>Maps de Maps no período de execução: "

#. Tag: programlisting
#: persistent_classes.xml:281
#, no-c-format
msgid ""
"Session s = openSession();\n"
"Transaction tx = s.beginTransaction();\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"\n"
"// Create an organization\n"
"Map foobar = new HashMap();\n"
"foobar.put(\"name\", \"Foobar Inc.\");\n"
"\n"
"// Link both\n"
"david.put(\"organization\", foobar);\n"
"\n"
"// Save both\n"
"s.save(\"Customer\", david);\n"
"s.save(\"Organization\", foobar);\n"
"\n"
"tx.commit();\n"
"s.close();"
msgstr ""

#. Tag: para
#: persistent_classes.xml:283
#, no-c-format
msgid ""
"One of the main advantages of dynamic mapping is quick turnaround time for "
"prototyping, without the need for entity class implementation. However, you "
"lose compile-time type checking and will likely deal with many exceptions at "
"runtime. As a result of the Hibernate mapping, the database schema can "
"easily be normalized and sound, allowing to add a proper domain model "
"implementation on top later on."
msgstr ""
"As vantagens de um mapeamento dinâmico são o tempo de retorno rápido para "
"realizar o protótipo sem a necessidade de implementar uma classe de "
"entidade. No entanto, você perde o tipo de tempo de compilação, verificando "
"e muito provavelmente terá que lidar com muitas exceções de tempo de espera. "
"Graças ao mapeamento do Hibernate, o esquema do banco de dados pode ser "
"facilmente normalizado e seguro, permitindo adicionar uma implementação "
"modelo de domínio apropriado na camada do topo num futuro próximo. "

#. Tag: para
#: persistent_classes.xml:290
#, no-c-format
msgid ""
"Entity representation modes can also be set on a per <literal>Session:"

#. Tag: programlisting
#: persistent_classes.xml:293
#, no-c-format
msgid ""
"Session dynamicSession = pojoSession.getSession(EntityMode.MAP);\n"
"\n"
"// Create a customer\n"
"Map david = new HashMap();\n"
"david.put(\"name\", \"David\");\n"
"dynamicSession.save(\"Customer\", david);\n"
"...\n"
"dynamicSession.flush();\n"
"dynamicSession.close()\n"
"...\n"
"// Continue on pojoSession"
msgstr ""

#. Tag: para
#: persistent_classes.xml:295
#, no-c-format
msgid ""
"Please note that the call to <literal>getSession() using an "
"<literal>EntityMode is on the Session API, not "
"the <literal>SessionFactory. That way, the new Sessionclose() on the secondary Session usando "
"um <literal>EntityMode está na API de Session e "
"não na <literal>SessionFactory. Dessa forma, a nova "
"<literal>Session compartilha a conexão, transação e outra "
"informação de contexto JDBC adjacente. Isto significa que você não precisará "
"chamar <literal>flush() e close() na "
"<literal>Session secundária, e também deixar a transação e o "
"manuseio da conexão para a unidade primária do trabalho. "

#. Tag: para
#: persistent_classes.xml:304
#, fuzzy, no-c-format
msgid ""
"More information about the XML representation capabilities can be found in "
"<xref linkend=\"xml\"/>."
msgstr ""
"Você poderá encontrar maiores informações sobre as atividades de "
"representação XML em <xref linkend=\"xml\" />. "

#. Tag: title
#: persistent_classes.xml:310
#, no-c-format
msgid "Tuplizers"
msgstr "Tuplizadores"

#. Tag: para
#: persistent_classes.xml:312
#, fuzzy, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.Tuplizer and its sub-"
"interfaces are responsible for managing a particular representation of a "
"piece of data given that representation's <classname>org.hibernate."
"EntityMode</classname>. If a given piece of data is thought of as a data "
"structure, then a tuplizer is the thing that knows how to create such a data "
"structure, how to extract values from such a data structure and how to "
"inject values into such a data structure. For example, for the POJO entity "
"mode, the corresponding tuplizer knows how create the POJO through its "
"constructor. It also knows how to access the POJO properties using the "
"defined property accessors."
msgstr ""
"<literal>org.hibernate.tuple.Tuplizer, e suas sub-interfaces, são "
"responsáveis por gerenciar uma certa representação de uma parte de dado, "
"dada a <literal>org.hibernate.EntityMode da representação. Se uma "
"parte de dado é tida como uma estrutura de dado, então o tuplizador se "
"encarrega de criar tal estrutura de dado e como extrair e injetar valores de "
"e em tal estrutura de dados. Por exemplo, para um modo POJO, o tuplizador "
"correspondente sabe como criar um POJO através de seu construtor. Além "
"disso, ele sabe como acessar propriedades de POJO usando assessores de "
"propriedades definidas. "

#. Tag: para
#: persistent_classes.xml:322
#, no-c-format
msgid "There are two (high-level) types of Tuplizers:"
msgstr ""

#. Tag: para
#: persistent_classes.xml:326
#, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.entity.EntityTuplizer "
"which is responsible for managing the above mentioned contracts in regards "
"to entities"
msgstr ""

#. Tag: para
#: persistent_classes.xml:332
#, no-c-format
msgid ""
"<interfacename>org.hibernate.tuple.component.ComponentTuplizer implementation other than "
"<classname>java.util.HashMap be used while in the dynamic-map "
"entity-mode. Or perhaps you need to define a different proxy generation "
"strategy than the one used by default. Both would be achieved by defining a "
"custom tuplizer implementation. Tuplizer definitions are attached to the "
"entity or component mapping they are meant to manage. Going back to the "
"example of our <classname>Customer entity,  "
"using annotations while <xref linkend=\"example-specify-custom-tuplizer-xml"
"\"/> shows how to do the same in <literal>hbm.xml"
msgstr ""
"Os usuários podem também plugar seu próprio tuplizador. Talvez você queira "
"usar uma implementação <literal>java.util.Map ao invés de uma "
"<literal>java.util.HashMap enquanto estiver no modo de entidade "
"mapa dinâmico, ou talvez você precise definir uma estratégia de geração de "
"proxy diferente, ao invés de uma utilizada por padrão. Ambas seriam "
"alcançadas definindo uma implementação de tuplizador personalizada. As "
"definições do tuplizador estão anexadas à entidade ou ao mapeamento de "
"componente que tiverem que gerenciar. Retornando ao exemplo da entidade do "
"nosso cliente:"

#. Tag: title
#: persistent_classes.xml:353
#, no-c-format
msgid "Specify custom tuplizers in annotations"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:354
#, no-c-format
msgid ""
"@Entity\n"
"@Tuplizer(impl = DynamicEntityTuplizer.class)\n"
"public interface Cuisine {\n"
"    @Id\n"
"    @GeneratedValue\n"
"    public Long getId();\n"
"    public void setId(Long id);\n"
"\n"
"    public String getName();\n"
"    public void setName(String name);\n"
"\n"
"    @Tuplizer(impl = DynamicComponentTuplizer.class)\n"
"    public Country getCountry();\n"
"    public void setCountry(Country country);\n"
"}"
msgstr ""

#. Tag: title
#: persistent_classes.xml:357
#, no-c-format
msgid "Specify custom tuplizers in <literal>hbm.xml"
msgstr ""

#. Tag: programlisting
#: persistent_classes.xml:358
#, no-c-format
msgid ""
"<hibernate-mapping>\n"
"    <class entity-name=\"Customer\">\n"
"        <!--\n"
"            Override the dynamic-map entity-mode\n"
"            tuplizer for the customer entity\n"
"        -->\n"
"        <tuplizer entity-mode=\"dynamic-map\"\n"
"                class=\"CustomMapTuplizerImpl\"/>\n"
"\n"
"        <id name=\"id\" type=\"long\" column=\"ID\">\n"
"            <generator class=\"sequence\"/>\n"
"        </id>\n"
"\n"
"        <!-- other properties -->\n"
"        ...\n"
"    </class>\n"
"</hibernate-mapping>"
msgstr ""

#. Tag: title
#: persistent_classes.xml:363
#, no-c-format
msgid "EntityNameResolvers"
msgstr "EntityNameResolvers"

#. Tag: para
#: persistent_classes.xml:365
#, fuzzy, no-c-format
msgid ""
"<interfacename>org.hibernate.EntityNameResolver is a "
"contract for resolving the entity name of a given entity instance. The "
"interface defines a single method <methodname>resolveEntityName "
"which is passed the entity instance and is expected to return the "
"appropriate entity name (null is allowed and would indicate that the "
"resolver does not know how to resolve the entity name of the given entity "
"instance). Generally speaking, an <interfacename>org.hibernate."
"EntityNameResolver</interfacename> is going to be most useful in the case of "
"dynamic models. One example might be using proxied interfaces as your domain "
"model. The hibernate test suite has an example of this exact style of usage "
"under the <package>org.hibernate.test.dynamicentity.tuplizer2. "
"Here is some of the code from that package for illustration."
msgstr ""
"A interface <interfacename>org.hibernate.EntityNameResolver "
"é um contrato para resolver o nome da entidade de uma instância de entidade "
"dada. A interface define um <methodname>resolveEntityName de "
"método único que é passado à instância de entidade e é esperado a retornar "
"ao nome de entidade apropriado (nulo é permitido e indicaria que o "
"solucionador não saiba como resolver o nome de entidade da instância de "
"entidade dada). Normalmente, um <interfacename>org.hibernate."
"EntityNameResolver</interfacename> será mais útil no caso de modelos "
"dinâmicos. Um exemplo poderá ser usado nas interfaces com proxie no caso dos "
"modelos dinâmicos. O hibernate test suite possui um exemplo deste estilo "
"exato de uso sob o <package>org.hibernate.test.dynamicentity.tuplizer2getEntityNameResolvers "
"method"
msgstr ""
"Implementar um <link linkend=\"persistent-classes-tuplizers\">Tuplizer."

#. Tag: para
#: persistent_classes.xml:389
#, no-c-format
msgid ""
"Register it with the <classname>org.hibernate.impl.SessionFactoryImplorg."
"hibernate.SessionFactory</interfacename>) using the "
"<methodname>registerEntityNameResolver method."
msgstr ""
"Registrá-lo com o <classname>org.hibernate.impl.SessionFactoryImplorg."
"hibernate.SessionFactory</interfacename>) usando o método "
"<methodname>registerEntityNameResolver."

#~ msgid ""
#~ "Most Java applications require a persistent class representing felines. "
#~ "For example:"
#~ msgstr ""
#~ "A maior parte dos aplicativos Java requerem uma classe persistente que "
#~ "representa os felinos. Por exemplo:"

#~ msgid ""
#~ "<literal>Cat has a property called id. This "
#~ "property maps to the primary key column of a database table. The property "
#~ "might have been called anything, and its type might have been any "
#~ "primitive type, any primitive \"wrapper\" type, <literal>java.lang."
#~ "String</literal> or java.util.Date. If your legacy "
#~ "database table has composite keys, you can use a user-defined class with "
#~ "properties of these types (see the section on composite identifiers later "
#~ "in the chapter.)"
#~ msgstr ""
#~ "<literal>Cat possui uma propriedade chamada id ou java."
#~ "util.Date</literal>. Se sua tabela de banco de dados de legacia possuir "
#~ "chaves compostas, você também poderá usar uma classe de usuário definido, "
#~ "com propriedades destes tipos (veja a seção de identificadores compostos "
#~ "mais adiante.)"

#~ msgid ""
#~ "The identifier property is strictly optional. You can leave them off and "
#~ "let Hibernate keep track of object identifiers internally. We do not "
#~ "recommend this, however."
#~ msgstr ""
#~ "A propriedade de identificador é estritamente opcional. Você pode deixá-"
#~ "los desligados e deixar que o Hibernate encontre os identificadores de "
#~ "objeto internamente. No entanto, não recomendamos que faça isto."

#~ msgid ""
#~ "In fact, some functionality is available only to classes that declare an "
#~ "identifier property:"
#~ msgstr ""
#~ "Na verdade, algumas funcionalidades estão disponíveis somente para "
#~ "classes que declaram uma propriedade de identificador:"

#~ msgid ""
#~ "Transitive reattachment for detached objects (cascade update or cascade "
#~ "merge) - see <xref linkend=\"objectstate-transitive\" />"
#~ msgstr ""
#~ "Reconexão transitiva para objetos desanexados (atualização de cascata ou "
#~ "mesclagem de cascata) - veja <xref linkend=\"objectstate-transitive\" />"

#~ msgid "<literal>Session.saveOrUpdate()"
#~ msgstr "<literal>Session.saveOrUpdate()"

#~ msgid "<literal>Session.merge()"
#~ msgstr "<literal>Session.merge()"

#~ msgid ""
#~ "A central feature of Hibernate, <emphasis>proxies, depends "
#~ "upon the persistent class being either non-final, or the implementation "
#~ "of an interface that declares all public methods."
#~ msgstr ""
#~ "Um recurso central do Hibernate, <emphasis>proxies, depende da "
#~ "classe persistente ser tanto não final como uma implementação de uma "
#~ "interface que declare todos os métodos públicos."

#~ msgid ""
#~ "You can persist <literal>final classes that do not implement an "
#~ "interface with Hibernate. You will not, however, be able to use proxies "
#~ "for lazy association fetching which will ultimately limit your options "
#~ "for performance tuning."
#~ msgstr ""
#~ "Você pode persistir as classes <literal>final que não "
#~ "implementam uma interface com o Hibernate, mas não poderá usar os proxies "
#~ "para busca por associação lazy, que irá limitar suas opções para ajuste "
#~ "de desempenho. "

#~ msgid ""
#~ "There are two high-level types of Tuplizers, represented by the "
#~ "<literal>org.hibernate.tuple.entity.EntityTuplizer and "
#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer "
#~ "interfaces. <literal>EntityTuplizers are responsible for "
#~ "managing the above mentioned contracts in regards to entities, while "
#~ "<literal>ComponentTuplizers do the same for components."
#~ msgstr ""
#~ "Existem dois tipos de alto nível de Tuplizadores, representados pelas "
#~ "interfaces <literal>org.hibernate.tuple.entity.EntityTuplizer e "
#~ "<literal>org.hibernate.tuple.component.ComponentTuplizer. Os "
#~ "<literal>EntityTuplizers são responsáveis pelo gerenciamento "
#~ "dos contratos mencionados acima em relação às entidades, enquanto os "
#~ "<literal>ComponentTuplizers realizam o mesmo para os "
#~ "componentes."

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate persistent_classes.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.