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

Hibernate example source code file (inheritance_mapping.po)

This example Hibernate source code file (inheritance_mapping.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, hibernate, hibernate, if, polim, polymorphic, tabela, table, tag, tag, the, the, there

The Hibernate inheritance_mapping.po source code

# translation of inheritance_mapping.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: inheritance_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2010-03-17 15:42+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 "Inheritance mapping"
msgstr "Mapeamento de Herança "

#. Tag: title
#, no-c-format
msgid "The three strategies"
msgstr "As três estratégias "

#. Tag: para
#, no-c-format
msgid "Hibernate supports the three basic inheritance mapping strategies:"
msgstr "O Hibernate suporta as três estratégias básicas de mapeamento de herança:"

#. Tag: para
#, no-c-format
msgid "table per class hierarchy"
msgstr "tabela por hierarquia de classes"

#. Tag: para
#, no-c-format
msgid "table per subclass"
msgstr "tabela por subclasse"

#. Tag: para
#, no-c-format
msgid "table per concrete class"
msgstr "tabela por classe concreta"

#. Tag: para
#, no-c-format
msgid ""
"In addition, Hibernate supports a fourth, slightly different kind of "
"polymorphism:"
msgstr ""
"Além disso, o Hibernate suporta um quarto tipo de polimorfismo um pouco "
"diferente:"

#. Tag: para
#, no-c-format
msgid "implicit polymorphism"
msgstr "polimorfismo implícito"

#. Tag: para
#, no-c-format
msgid ""
"It is possible to use different mapping strategies for different branches of "
"the same inheritance hierarchy. You can then make use of implicit "
"polymorphism to achieve polymorphism across the whole hierarchy. However, "
"Hibernate does not support mixing <literal><subclass>, "
"<literal><joined-subclass> and <union-"
"subclass></literal> mappings under the same root <class><subclass> and "
"<literal><join> elements (see below for an example)."
msgstr ""
"É possível usar diferentes estratégias de mapeamento para diferentes "
"ramificações da mesma hierarquia de herança. Você pode fazer uso do "
"polimorfismo implícito para alcançá-lo através da hierarquia completa. De "
"qualquer forma, o Hibernate não suporta a mistura de mapeamentos "
"<literal><subclass>, <joined-subclass><union-subclass> dentro do mesmo "
"elemento raíz <literal><class>. É possível usar, junto às "
"estratégias, uma tabela por hierarquia e tabela por subclasse, abaixo do "
"mesmo elemento <literal><class>, combinando os elementos "
"<literal><subclass> e <join> (veja "
"abaixo)."

#. Tag: para
#, no-c-format
msgid ""
"It is possible to define <literal>subclass, union-"
"subclass</literal>, and joined-subclass mappings in "
"separate mapping documents directly beneath <literal>hibernate-mapping attribute in "
"the subclass mapping, naming a previously mapped superclass. Previously this "
"feature made the ordering of the mapping documents important. Since "
"Hibernate3, the ordering of mapping files is irrelevant when using the "
"extends keyword. The ordering inside a single mapping file still needs to be "
"defined as superclasses before subclasses."
msgstr ""
"É possível definir mapeamentos <literal>subclass, union-"
"subclass</literal> e joined-subclass em documentos de "
"mapeamento separados, diretamente abaixo de <literal>hibernate-mapping no mapeamento da subclasse, nomeando uma "
"superclasse previamente mapeada. Anteriormente esta característica fazia o "
"ordenamento dos documentos de mapeamento importantes. Desde o Hibernate3, o "
"ordenamento dos arquivos de mapeamento não importa quando usamos a palavra "
"chave extends. O ordenamento dentro de um arquivo de mapeamento simples "
"ainda necessita ser definido como superclasse antes de subclasse."

#. Tag: title
#, no-c-format
msgid "Table per class hierarchy"
msgstr "Tabela por hierarquia de classes"

#. Tag: para
#, no-c-format
msgid ""
"Suppose we have an interface <literal>Payment with the "
"implementors <literal>CreditCardPayment, CashPaymentChequePayment. The table per hierarchy "
"mapping would display in the following way:"
msgstr ""
"Vamos supor que temos uma interface <literal>Payment, com sua "
"implementação <literal>CreditCardPayment, CashPaymentChequePayment. O mapeamento da tabela por "
"hierarquia seria parecido com:"

#. Tag: para
#, no-c-format
msgid ""
"Exactly one table is required. There is a limitation of this mapping "
"strategy: columns declared by the subclasses, such as <literal>CCTYPENOT NULL constraints."
msgstr ""
"É requisitado exatamente uma tabela. Existe uma grande limitação desta "
"estratégia de mapeamento: colunas declaradas por subclasses, tais como "
"<literal>CCTYPE, podem não ter restrições NOT NULL and "
"<literal><join>, as follows:"
msgstr ""
"A implementação de tabela por subclasse do Hibernate não necessita de coluna "
"de discriminador. Outro mapeador objeto/relacional usa uma implementação "
"diferente de tabela por subclasse, que necessita uma coluna com o tipo "
"discriminador na tabela da superclasse. A abordagem escolhida pelo Hibernate "
"é muito mais difícil de implementar, porém mais correto de um ponto de vista "
"relacional. Se você deseja utilizar uma coluna discriminadora com a "
"estratégia tabela por subclasse, você poderá combinar o uso de <literal><"
"subclass></literal> e <join>, dessa maneira:"

#. Tag: para
#, no-c-format
msgid ""
"The optional <literal>fetch=\"select\" declaration tells Hibernate "
"not to fetch the <literal>ChequePayment subclass data using an "
"outer join when querying the superclass."
msgstr ""
"A declaração opcional <literal>fetch=\"select\" diz ao Hibernate "
"para não buscar os dados da subclasse <literal>ChequePayment, "
"quando usar uma união externa pesquisando a superclasse."

#. Tag: title
#, no-c-format
msgid "Mixing table per class hierarchy with table per subclass"
msgstr "Mesclar tabela por hierarquia de classes com tabela por subclasse"

#. Tag: para
#, no-c-format
msgid ""
"You can even mix the table per hierarchy and table per subclass strategies "
"using the following approach:"
msgstr ""
"Você pode até mesmo mesclar a estratégia de tabela por hierarquia e tabela "
"por subclasse usando esta abordagem:  "

#. Tag: para
#, no-c-format
msgid ""
"For any of these mapping strategies, a polymorphic association to the root "
"<literal>Payment class is mapped using <many-to-one>"
"</literal>."
msgstr ""
"Para qualquer uma dessas estratégias de mapeamento, uma associação "
"polimórfica para a classe raíz <literal>Payment deve ser mapeada "
"usando <literal><many-to-one>."

#. Tag: title
#, no-c-format
msgid "Table per concrete class"
msgstr "Tabela por classe concreta"

#. Tag: para
#, no-c-format
msgid ""
"There are two ways we can map the table per concrete class strategy. First, "
"you can use <literal><union-subclass>."
msgstr ""
"Existem duas formas que poderíamos usar a respeito da estratégia de "
"mapeamento de tabela por classe concreta. A primeira é usar <literal><"
"union-subclass></literal>. "

#. Tag: para
#, no-c-format
msgid ""
"Three tables are involved for the subclasses. Each table defines columns for "
"all properties of the class, including inherited properties."
msgstr ""
"Três tabelas estão envolvidas para as subclasses. Cada tabela define colunas "
"para todas as propriedades da classe, incluindo propriedades herdadas."

#. Tag: para
#, no-c-format
msgid ""
"The limitation of this approach is that if a property is mapped on the "
"superclass, the column name must be the same on all subclass tables. The "
"identity generator strategy is not allowed in union subclass inheritance. "
"The primary key seed has to be shared across all unioned subclasses of a "
"hierarchy."
msgstr ""
"A limitação dessa abordagem é que se uma propriedade é mapeada na "
"superclasse, o nome da coluna deve ser o mesmo em todas as tabelas das "
"subclasses. A estratégia do gerador identidade não é permitida na união da "
"herança de sub-classe. A fonte de chave primária deve ser compartilhada "
"através de todas subclasses unidas da hierarquia."

#. Tag: para
#, no-c-format
msgid ""
"If your superclass is abstract, map it with <literal>abstract=\"true\" in the example above), is needed to hold "
"instances of the superclass."
msgstr ""
"Se sua superclasse é abstrata, mapeie-a com <literal>abstract=\"true\" no exemplo acima), será necessária para "
"segurar as instâncias da superclasse."

#. Tag: title
#, no-c-format
msgid "Table per concrete class using implicit polymorphism"
msgstr "Tabela por classe concreta usando polimorfismo implícito"

#. Tag: para
#, no-c-format
msgid "An alternative approach is to make use of implicit polymorphism:"
msgstr "Uma abordagem alternativa é fazer uso de polimorfismo implícito:"

#. Tag: para
#, no-c-format
msgid ""
"Notice that the <literal>Payment interface is not mentioned "
"explicitly. Also notice that properties of <literal>Payment are "
"mapped in each of the subclasses. If you want to avoid duplication, consider "
"using XML entities (for example, <literal>[ <!ENTITY allproperties SYSTEM "
"\"allproperties.xml\"> ]</literal> in the DOCTYPE "
"declaration and <literal>&allproperties; in the mapping)."
msgstr ""
"Veja que em nenhum lugar mencionamos a interface <literal>Payment "
"explicitamente. Note também que propriedades de <literal>Payment "
"são mapeadas em cada uma das subclasses. Se você quiser evitar duplicação, "
"considere usar entidades de XML (ex. <literal>[ <!ENTITY allproperties "
"SYSTEM \"allproperties.xml\"> ]</literal> na declaração do "
"<literal>DOCTYPE e & allproperties; no "
"mapeamento). "

#. Tag: para
#, no-c-format
msgid ""
"The disadvantage of this approach is that Hibernate does not generate SQL "
"<literal>UNIONs when performing polymorphic queries."
msgstr ""
"A desvantagem dessa abordagem é que o Hibernate não gera <literal>UNION<any>."
msgstr ""
"Para essa estratégia, uma associação polimórfica para <literal>Payment<any>."

#. Tag: title
#, no-c-format
msgid "Mixing implicit polymorphism with other inheritance mappings"
msgstr "Mesclando polimorfismo implícito com outros mapeamentos de herança"

#. Tag: para
#, no-c-format
msgid ""
"Since the subclasses are each mapped in their own <literal><class>Payment is just an "
"interface), each of the subclasses could easily be part of another "
"inheritance hierarchy. You can still use polymorphic queries against the "
"<literal>Payment interface."
msgstr ""
"Existe ainda um item a ser observado sobre este mapeamento. Como as "
"subclasses são mapeadas em seu próprio elemento <literal><class>Payment é apenas uma interface, cada "
"uma das subclasses pode ser facilmente parte de uma outra hierarquia de "
"herança! (E você ainda pode usar pesquisas polimórficas em cima da interface "
"<literal>Payment.)"

#. Tag: para
#, no-c-format
msgid ""
"Once again, <literal>Payment is not mentioned explicitly. If we "
"execute a query against the <literal>Payment interface, for "
"example <literal>from Payment, Hibernate automatically returns "
"instances of <literal>CreditCardPayment (and its subclasses, since "
"they also implement <literal>Payment), CashPaymentChequePayment, but not instances of "
"<literal>NonelectronicTransaction."
msgstr ""
"Mais uma vez, nós não mencionamos <literal>Payment explicitamente. "
"Se nós executarmos uma pesquisa em cima da interface <literal>Paymentfrom Payment – o Hibernate retorna "
"automaticamente instâncias de <literal>CreditCardPayment (e suas "
"subclasses, desde que elas também implementem <literal>Payment), "
"<literal>CashPayment e ChequePayment mas não as "
"instâncias de <literal>NonelectronicTransaction. "

#. Tag: title
#, no-c-format
msgid "Limitations"
msgstr "Limitações"

#. Tag: para
#, no-c-format
msgid ""
"There are limitations to the \"implicit polymorphism\" approach to the table "
"per concrete-class mapping strategy. There are somewhat less restrictive "
"limitations to <literal><union-subclass> mappings."
msgstr ""
"Existem certas limitações para a abordagem do \"polimorfismo implícito\" "
"comparada com a estratégia de mapeamento da tabela por classe concreta. "
"Existe uma limitação um tanto menos restritiva para mapeamentos <literal><"
"union-subclass></literal>. "

#. Tag: para
#, no-c-format
msgid ""
"The following table shows the limitations of table per concrete-class "
"mappings, and of implicit polymorphism, in Hibernate."
msgstr ""
"A seguinte tabela demonstra as limitações do mapeamento de tabela por classe "
"concreta e do polimorfismo implícito no Hibernate. "

#. Tag: title
#, no-c-format
msgid "Features of inheritance mappings"
msgstr "Recurso dos Mapeamentos de Herança "

#. Tag: entry
#, no-c-format
msgid "Inheritance strategy"
msgstr "Estratégia de Herança "

#. Tag: entry
#, no-c-format
msgid "Polymorphic many-to-one"
msgstr "muitos-para-um Polimórfico"

#. Tag: entry
#, no-c-format
msgid "Polymorphic one-to-one"
msgstr "um-para-um Polimórfico"

#. Tag: entry
#, no-c-format
msgid "Polymorphic one-to-many"
msgstr "um-para-muitos Polimórfico"

#. Tag: entry
#, no-c-format
msgid "Polymorphic many-to-many"
msgstr "muitos-para-um Polimórfico"

#. Tag: entry
#, no-c-format
msgid "Polymorphic <literal>load()/get()"
msgstr "Polimórfico <literal>load()/get()"

#. Tag: entry
#, no-c-format
msgid "Polymorphic queries"
msgstr "Consultas Polimórficas"

#. Tag: entry
#, no-c-format
msgid "Polymorphic joins"
msgstr "Junçöes Polimórficas"

#. Tag: entry
#, no-c-format
msgid "Outer join fetching"
msgstr "Busca por união externa"

#. Tag: entry
#, no-c-format
msgid "table per class-hierarchy"
msgstr "tabela por hierarquia de class"

#. Tag: entry
#, no-c-format
msgid "<literal><many-to-one>"
msgstr "<literal><many-to-one>"

#. Tag: entry
#, no-c-format
msgid "<literal><one-to-one>"
msgstr "<literal><one-to-one>"

#. Tag: entry
#, no-c-format
msgid "<literal><one-to-many>"
msgstr "<literal><one-to-many>"

#. Tag: entry
#, no-c-format
msgid "<literal><many-to-many>"
msgstr "<literal><many-to-many>"

#. Tag: entry
#, no-c-format
msgid "<literal>s.get(Payment.class, id)"
msgstr "<literal>s.get(Payment.class, id)"

#. Tag: entry
#, no-c-format
msgid "<literal>from Payment p"
msgstr "<literal>from Payment p"

#. Tag: entry
#, no-c-format
msgid "<literal>from Order o join o.payment p"
msgstr "<literal>from Order o join o.payment p"

#. Tag: entry
#, no-c-format
msgid "<emphasis>supported"
msgstr "<emphasis>supported"

#. Tag: entry
#, no-c-format
msgid "table per concrete-class (union-subclass)"
msgstr "tabela por classe concreta (subclasses de união)"

#. Tag: entry
#, no-c-format
msgid ""
"<literal><one-to-many> (for inverse=\"true\" (for inverse=\"true\""
msgstr "<literal><any>"

#. Tag: entry
#, no-c-format
msgid "<emphasis>not supported"
msgstr "<emphasis>not supported"

#. Tag: entry
#, no-c-format
msgid "<literal><many-to-any>"
msgstr "<literal><many-to-any>"

#. Tag: entry
#, no-c-format
msgid ""
"<literal>s.createCriteria(Payment.class).add( Restrictions.idEq(id) )."
"uniqueResult()</literal>"
msgstr ""
"<literal>s.createCriteria(Payment.class).add( Restrictions.idEq(id) )."
"uniqueResult()</literal>"

Other Hibernate examples (source code examples)

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