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

hibernate, hibernate, if, la, la, polim, polymorphic, si, tabla, table, tag, tag, the, the

The Hibernate inheritance_mapping.po source code

# translation of inheritance_mapping.po to
# Michael H. Smith <mhideo@redhat.com>, 2007.
# Angela Garcia <agarcia@redhat.com>, 2009, 2010.
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
# translation of Collection_Mapping.po to
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-15 15:51+1000\n"
"Last-Translator: Angela Garcia <agarcia@redhat.com>\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 "Mapeo de herencias"

#. Tag: title
#, no-c-format
msgid "The three strategies"
msgstr "Las tres estrategias"

#. Tag: para
#, no-c-format
msgid "Hibernate supports the three basic inheritance mapping strategies:"
msgstr "Hibernate soporta las tres estrategias básicas de mapeo de herencia:"

#. Tag: para
#, no-c-format
msgid "table per class hierarchy"
msgstr "tabla por jerarquía de clases"

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

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

#. Tag: para
#, no-c-format
msgid ""
"In addition, Hibernate supports a fourth, slightly different kind of "
"polymorphism:"
msgstr ""
"Además, Hibernate soporta un cuarto, un tipo ligeramente diferente de "
"polimorfismo:"

#. 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 ""
"Es posible utilizar estrategias de mapeo diferentes para diferentes "
"ramificaciones de la misma jerarquía de herencia. Luego puede usar un "
"polimorfismo implícito para conseguir polimorfismo a través de toda la "
"jerarquía. Sin embargo, Hibernate no soporta la mezcla de mapeos "
"<literal><subclass>, <joined-subclass><union-subclass> bajo el mismo elemento "
"<literal><class> raíz. Es posible mezclar las estrategias de "
"tabla por jerarquía y tabla por subclase bajo el mismo elemento <literal><"
"class></literal>, combinando los elementos <subclass><join> (a continuación encontrará un "
"ejemplo)."

#. 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 ""
"Es posible definir los mapeos <literal>subclass, union-"
"subclass</literal>, y joined-subclass en documentos de "
"mapeo separados, directamente debajo de <literal>hibernate-mapping en la subclase de mapeo, nombrando una superclase "
"mapeada previamente. Nota: Anteriormente esta característica hacia que el "
"orden de los documentos de mapeo fuera importante. Desde Hibernate3, el "
"orden de los archivos de mapeo no tiene relevancia cuando se utiliza la "
"palabra clave extends. El orden dentro de un sólo archivo de mapeo todavía "
"necesita ser definido como superclases antes de subclases."

#. Tag: title
#, no-c-format
msgid "Table per class hierarchy"
msgstr "Tabla por jerarquía de clases"

#. 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 ""
"Suponga que tenemos una interfaz <literal>Payment, con los "
"implementadores <literal>CreditCardPayment, CashPaymentChequePayment. El mapeo de tabla por jerarquía "
"se vería así: "

#. 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 ""
"Se requiere exactamente una tabla. Hay una limitación de esta estrategia de "
"mapeo: las columnas declaradas por las subclases tal como <literal>CCTYPENOT NULL."

#. Tag: title
#, no-c-format
msgid "Table per subclass"
msgstr "Tabla por subclase"

#. Tag: para
#, no-c-format
msgid "A table per subclass mapping looks like this:"
msgstr "Un mapeo de tabla por subclase se vería así: "

#. Tag: para
#, no-c-format
msgid ""
"Four tables are required. The three subclass tables have primary key "
"associations to the superclass table so the relational model is actually a "
"one-to-one association."
msgstr ""
"Se necesitan cuatro tablas. Las tres tablas de subclase tienen asociaciones "
"de clave principal a la tabla de superclase de modo que en el modelo "
"relacional es realmente una asociación uno-a-uno."

#. Tag: title
#, no-c-format
msgid "Table per subclass: using a discriminator"
msgstr "Tabla por subclase: utilizando un discriminador"

#. Tag: para
#, no-c-format
msgid ""
"Hibernate's implementation of table per subclass does not require a "
"discriminator column. Other object/relational mappers use a different "
"implementation of table per subclass that requires a type discriminator "
"column in the superclass table. The approach taken by Hibernate is much more "
"difficult to implement, but arguably more correct from a relational point of "
"view. If you want to use a discriminator column with the table per subclass "
"strategy, you can combine the use of <literal><subclass> and "
"<literal><join>, as follows:"
msgstr ""
"La implementación de Hibernate de tabla por subclase no requiere ninguna "
"columna discriminadora. Otros mapeadores objeto/relacional usan una "
"implementación diferente de tabla por subclase que necesita una columna "
"discriminadora de tipo en la tabla de superclase. Este enfoque es mucho más "
"difícil de implementar pero discutiblemente más correcto desde un punto de "
"vista relacional. Si quisiere utilizar una columna discriminadora con la "
"estrategia de tabla por subclase, puede combinar el uso de <literal><"
"subclass></literal> y <join>, así:"

#. 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 ""
"La declaración opcional <literal>fetch=\"select\" le dice a "
"Hibernate que no recupere los datos de la subclase <literal>ChequePayment class is mapped using <many-to-one>"
"</literal>."
msgstr ""
"Para cualquiera de estas estrategias de mapeo, una asociación polimórfica a "
"la clase raíz <literal>Payment es mapeada usando <many-"
"to-one></literal>."

#. Tag: title
#, no-c-format
msgid "Table per concrete class"
msgstr "Tabla por clase 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 ""
"Hay dos maneras de mapear la tabla por estrategia de clase concreta. La "
"primera es utilizar <literal><union-subclass>."

#. 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 ""
"Hay tres tablas involucradas. Cada tabla define columnas para todas las "
"propiedades de la clase, incluyendo las propiedades heredadas."

#. 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 ""
"La limitación de este enfoque es que si una propiedad se mapea en la "
"superclase, el nombre de la columna debe ser el mismo en todas las tablas de "
"subclase. La estrategia del generador de identidad no está permitida en la "
"herencia de unión de subclase. La semilla de la clave principal tiene que "
"compartirse a través de todas las subclases unidas de una jerarquía."

#. 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 ""
"Si su superclase es abstracta, mapeéla con <literal>abstract=\"true\") para mantener las "
"instancias de la superclase."

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

#. Tag: para
#, no-c-format
msgid "An alternative approach is to make use of implicit polymorphism:"
msgstr "Un enfoque alternativo es para hacer uso del 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 ""
"Observe que la interfaz <literal>Payment no se menciona "
"explícitamente. También note que las propiedades de <literal>Payment y &allproperties;s when performing polymorphic queries."
msgstr ""
"La desventaja de este enfoque es que Hibernate no genera <literal>UNION<any>."
msgstr ""
"Para esta estrategia de mapeo, una asociación polimórfica a "
"<literal>Payment es mapeada generalmente utilizando <"
"any></literal>."

#. Tag: title
#, no-c-format
msgid "Mixing implicit polymorphism with other inheritance mappings"
msgstr "Mezcla de polimorfismo implícito con otros mapeos de herencia"

#. 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 ""
"Ya que las subclases se mapean cada una en su propio elemento <literal><"
"class></literal> y debido a que Payment es sólo una "
"interfaz, cada una de las subclases podría ser fácilmente parte de otra "
"jerarquía de herencia. Todavía puede seguir usando consultas polimórficas "
"contra la interfaz <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 ""
"Una vez más, no mencionamos a <literal>Payment explícitamente. Si "
"ejecutamos una consulta frente a la interfaz <literal>Payment - "
"por ejemplo, <literal>from Payment, Hibernate retorna "
"automáticamente instancias de <literal>CreditCardPayment (y sus "
"subclases, ya que ellas también implementan <literal>Payment), "
"<literal>CashPayment y ChequePayment pero no "
"las instancias de <literal>NonelectronicTransaction."

#. Tag: title
#, no-c-format
msgid "Limitations"
msgstr "Limitaciones"

#. 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 ""
"Existen ciertas limitaciones al enfoque de \"polimorfismo implícito\" en la "
"estrategia de mapeo de tabla por clase concreta. Existen limitaciones un "
"poco menos restrictivas a los mapeos <literal><union-subclass>"
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 "Uniones polimórficas"

#. Tag: entry
#, no-c-format
msgid "Outer join fetching"
msgstr "Recuperación por unión externa"

#. Tag: entry
#, no-c-format
msgid "table per class-hierarchy"
msgstr "tabla por jerarquía de clases "

#. 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>soportado"

#. Tag: entry
#, no-c-format
msgid "table per concrete-class (union-subclass)"
msgstr "tabla por clase concreta (union-subclass)"

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

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

#. 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.