|
Hibernate example source code file (association_mapping.po)
This example Hibernate source code file (association_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.
The Hibernate association_mapping.po source code
# translation of association_mapping.po to
# Michael H. Smith <mhideo@redhat.com>, 2007.
# Angela Garcia <agarcia@redhat.com>, 2009.
# 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: association_mapping\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-02-10T07:25:34\n"
"PO-Revision-Date: 2009-11-09 12:44+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 "Association Mappings"
msgstr "Mapeos de asociación"
#. Tag: title
#, no-c-format
msgid "Introduction"
msgstr "Introducción"
#. Tag: para
#, no-c-format
msgid ""
"Association mappings are often the most difficult thing to implement "
"correctly. In this section we examine some canonical cases one by one, "
"starting with unidirectional mappings and then bidirectional cases. We will "
"use <literal>Person and Address in all the "
"examples."
msgstr ""
"Los mapeos de asociación son frecuentemente lo más difícil de implementar "
"correctamente. En esta sección revisaremos algunos casos canónicos uno por "
"uno, comenzando con los mapeos unidireccionales y luego considerando los "
"casos bidireccionales. Vamos a utilizar <literal>Person y "
"<literal>Address en todos los ejemplos."
#. Tag: para
#, no-c-format
msgid ""
"Associations will be classified by multiplicity and whether or not they map "
"to an intervening join table."
msgstr ""
"Vamos a clasificar las asociaciones en cuanto su multiplicidad y a si mapean "
"o no a una tabla de unión interviniente."
#. Tag: para
#, no-c-format
msgid ""
"Nullable foreign keys are not considered to be good practice in traditional "
"data modelling, so our examples do not use nullable foreign keys. This is "
"not a requirement of Hibernate, and the mappings will work if you drop the "
"nullability constraints."
msgstr ""
"Las claves foráneas que aceptan valores nulos no se consideran como una "
"buena práctica en el modelado tradicional de datos, así que todos nuestros "
"ejemplos utilizan claves foráneas no nulas. Esto no es un requisito de "
"Hibernate y todos los mapeos funcionarán si quita las restricciones de "
"nulabilidad."
#. Tag: title
#, no-c-format
msgid "Unidirectional associations"
msgstr "Asociaciones Unidireccionales"
#. Tag: title
#, no-c-format
msgid "Many-to-one"
msgstr "Many-to-one"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional many-to-one association is the most "
"common kind of unidirectional association."
msgstr ""
"Una <emphasis>asociación unidireccional muchos-a-uno es el tipo "
"de asociación unidireccional más común."
#. Tag: title
#, no-c-format
msgid "One-to-one"
msgstr "Uno-a-uno"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional one-to-one association on a foreign key"
"emphasis> is almost identical. The only difference is the column unique "
"constraint."
msgstr ""
"Una <emphasis>asociación unidireccional uno-a-uno en una clave foránea"
"emphasis> es casi idéntica. La única diferencia es la restricción de "
"unicidad de la columna."
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional one-to-one association on a primary key"
"emphasis> usually uses a special id generator In this example, however, we "
"have reversed the direction of the association:"
msgstr ""
"Usualmente, una <emphasis>asociación unidireccional uno-a-uno en una clave "
"principal</emphasis> utiliza un generador de id especial. Sin embargo, hemos "
"invertido la dirección de la asociación:"
#. Tag: title
#, no-c-format
msgid "One-to-many"
msgstr "Uno-a-muchos"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional one-to-many association on a foreign key"
"emphasis> is an unusual case, and is not recommended."
msgstr ""
"Una <emphasis>asociación unidireccional uno-a-muchos en una clave foránea"
"emphasis> es un caso muy inusual y no se recomienda."
#. Tag: para
#, no-c-format
msgid "You should instead use a join table for this kind of association."
msgstr ""
"En lugar debe utilizar una tabla de unión para esta clase de asociación."
#. Tag: title
#, no-c-format
msgid "Unidirectional associations with join tables"
msgstr "Asociaciones unidireccionales con tablas de unión"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional one-to-many association on a join table"
"emphasis> is the preferred option. Specifying <literal>unique=\"true\""
"literal>, changes the multiplicity from many-to-many to one-to-many."
msgstr ""
"Se prefiere una <emphasis>asociación unidireccional uno-a-muchos en una "
"tabla de unión</emphasis> . El especificar unique=\"true\""
"literal>, cambia la multiplicidad de muchos-a-muchos a uno-a-muchos."
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional many-to-one association on a join table"
"emphasis> is common when the association is optional. For example:"
msgstr ""
"Una <emphasis>asociación unidireccional muchos-a-uno en una tabla de unión"
"emphasis> es común cuando la asociación es opcional. Por ejemplo:"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>unidirectional one-to-one association on a join table "
"is possible, but extremely unusual."
msgstr ""
"Una <emphasis>asociación unidireccional uno-a-uno en una tabla de unión"
"emphasis> es extremadamente inusual, pero es posible. "
#. Tag: title
#, no-c-format
msgid "Many-to-many"
msgstr "Muchos-a-muchos"
#. Tag: para
#, no-c-format
msgid ""
"Finally, here is an example of a <emphasis>unidirectional many-to-many "
"association</emphasis>."
msgstr ""
"Finalmente, este es un ejemplo de una <emphasis>asociación unidireccional "
"muchos-a-muchos</emphasis>."
#. Tag: title
#, no-c-format
msgid "Bidirectional associations"
msgstr "Asociaciones bidireccionales"
#. Tag: title
#, no-c-format
msgid "one-to-many / many-to-one"
msgstr "uno-a-muchos / muchos-a-uno"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>bidirectional many-to-one association is the most "
"common kind of association. The following example illustrates the standard "
"parent/child relationship."
msgstr ""
"Una <emphasis>asociación bidireccional muchos-a-uno es el tipo de "
"asociación más común. El siguiente ejemplo ilustra la relación estándar "
"padre/hijo."
#. Tag: para
#, no-c-format
msgid ""
"If you use a <literal>List, or other indexed collection, set the "
"<literal>key column of the foreign key to not null"
"literal>. Hibernate will manage the association from the collections side to "
"maintain the index of each element, making the other side virtually inverse "
"by setting <literal>update=\"false\" and insert=\"false"
"\"</literal>:"
msgstr ""
"Si utiliza un <literal>List, u otra colección con índice, "
"configure la columna <literal>key de la clave foránea como "
"<literal>not null. Hibernate administrará la asociación del lado "
"de las colecciones para mantener el índice de cada elemento, haciendo del "
"otro lado virtualmente inverso al establecer <literal>update=\"false\""
"literal> y <literal>insert=\"false\":"
#. Tag: para
#, no-c-format
msgid ""
"If the underlying foreign key column is <literal>NOT NULL, it is "
"important that you define <literal>not-null=\"true\" on the "
"<literal><key> element of the collection mapping. Do not "
"only declare <literal>not-null=\"true\" on a possible nested "
"<literal><column> element, but on the <key>"
"literal> element."
msgstr ""
"Es importante que defina <literal>not-null=\"true\" en el elemento "
"<literal><key> del mapeo de la colección si la columna de la "
"clave foránea es <literal>NOT NULL. No declare sólamente "
"<literal>not-null=\"true\" en un elemento <column>"
"literal> posiblemente anidado sino en el elemento <literal><key>"
"literal>. "
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>bidirectional one-to-one association on a foreign key "
"is common:"
msgstr ""
"Una <emphasis>asociación bidireccional uno-a-uno en una clave foránea"
"emphasis> es común:"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>bidirectional one-to-one association on a primary key "
"uses the special id generator:"
msgstr ""
"Una <emphasis>asociación bidireccional uno-a-uno en una clave primaria"
"emphasis> utiliza el generador de id especial:"
#. Tag: title
#, no-c-format
msgid "Bidirectional associations with join tables"
msgstr "Asociaciones bidireccionales con tablas de unión"
#. Tag: para
#, no-c-format
msgid ""
"The following is an example of a <emphasis>bidirectional one-to-many "
"association on a join table</emphasis>. The inverse=\"true\""
"literal> can go on either end of the association, on the collection, or on "
"the join."
msgstr ""
"El siguiente es un ejemplo de una <emphasis>asociación bidireccional uno-a-"
"muchos en una tabla de unión</emphasis>. El inverse=\"true\""
"literal> puede ir en cualquier lado de la asociación, en la colección, o en "
"la unión."
#. Tag: title
#, no-c-format
msgid "one to one"
msgstr "uno a uno"
#. Tag: para
#, no-c-format
msgid ""
"A <emphasis>bidirectional one-to-one association on a join table "
"is possible, but extremely unusual."
msgstr ""
"Una <emphasis>asociación bidireccional uno-a-uno en una tabla de unión"
"emphasis> es extremadamente inusual, pero es posible. "
#. Tag: para
#, no-c-format
msgid ""
"Here is an example of a <emphasis>bidirectional many-to-many association"
"emphasis>."
msgstr ""
"Este es un ejemplo de una <emphasis>asociación bidireccional muchos-a-"
"muchos</emphasis>."
#. Tag: title
#, no-c-format
msgid "More complex association mappings"
msgstr "Mapeos de asociación más complejos"
#. Tag: para
#, no-c-format
msgid ""
"More complex association joins are <emphasis>extremely rare. "
"Hibernate handles more complex situations by using SQL fragments embedded in "
"the mapping document. For example, if a table with historical account "
"information data defines <literal>accountNumber, "
"<literal>effectiveEndDate and effectiveStartDate"
"literal>columns, it would be mapped as follows:"
msgstr ""
"Uniones de asociación más complejas son <emphasis>extremadamente "
"raras. Hibernate maneja situaciones más complejas utilizando fragmentos SQL "
"incluidos en el documento de mapeo. Por ejemplo, si una tabla con datos "
"históricos de información de cuenta define las columnas "
"<literal>accountNumber, effectiveEndDate y "
"<literal>effectiveStartDate, se mapearían así:"
#. Tag: para
#, no-c-format
msgid ""
"You can then map an association to the <emphasis>current "
"instance, the one with null <literal>effectiveEndDate, by using:"
msgstr ""
"Entonces puede mapear una asociación a la instancia <emphasis>actual"
"emphasis>, la que tiene <literal>effectiveEndDate nulo, utilizando:"
#. Tag: para
#, no-c-format
msgid ""
"In a more complex example, imagine that the association between "
"<literal>Employee and Organization is "
"maintained in an <literal>Employment table full of historical "
"employment data. An association to the employee's <emphasis>most recent"
"emphasis> employer, the one with the most recent <literal>startDate"
"literal>, could be mapped in the following way:"
msgstr ""
"En un ejemplo más complejo, imagínese que la asociación entre "
"<literal>Employee y Organization se mantienen "
"en una tabla <literal>Employment llena de datos históricos de "
"empleo. Entonces se puede mapear una asociación al empleador <emphasis>más "
"reciente</emphasis> del empleado, el que tiene la startDate"
"literal> más reciente, de esta manera:"
#. Tag: para
#, no-c-format
msgid ""
"This functionality allows a degree of creativity and flexibility, but it is "
"more practical to handle these kinds of cases using HQL or a criteria query."
msgstr ""
"Esta funcionalidad le permite cierto grado de creatividad y flexibilidad, "
"pero usualmente es más práctico manejar esta clase de casos utilizando HQL o "
"una petición de criterio."
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key, addressId "
#~ "bigint not null )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key, addressId "
#~ "bigint not null )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key, addressId "
#~ "bigint not null unique )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key, addressId "
#~ "bigint not null unique )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA[\n"
#~ " </generator>\n"
#~ " </id>\n"
#~ " <one-to-one name=\"person\" constrained=\"true\"/>\n"
#~ "</class>]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ " </generator>\n"
#~ " </id>\n"
#~ " <one-to-one name=\"person\" constrained=\"true\"/>\n"
#~ "</class>]]>"
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table Address ( personId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table Address ( personId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table Address ( addressId bigint not null primary key, personId "
#~ "bigint not null )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table Address ( addressId bigint not null primary key, personId "
#~ "bigint not null )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId not null, addressId bigint not null "
#~ "primary key )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId not null, addressId bigint not null "
#~ "primary key )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null primary key, "
#~ "addressId bigint not null )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null primary key, "
#~ "addressId bigint not null )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null primary key, "
#~ "addressId bigint not null unique )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null primary key, "
#~ "addressId bigint not null unique )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null, addressId bigint "
#~ "not null, primary key (personId, addressId) )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null, addressId bigint "
#~ "not null, primary key (personId, addressId) )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ " </generator>\n"
#~ " </id>\n"
#~ " <one-to-one name=\"person\" \n"
#~ " constrained=\"true\"/>\n"
#~ "</class>]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ " </generator>\n"
#~ " </id>\n"
#~ " <one-to-one name=\"person\" \n"
#~ " constrained=\"true\"/>\n"
#~ "</class>]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null, addressId bigint "
#~ "not null primary key )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "create table Person ( personId bigint not null primary key )\n"
#~ "create table PersonAddress ( personId bigint not null, addressId bigint "
#~ "not null primary key )\n"
#~ "create table Address ( addressId bigint not null primary key )\n"
#~ " ]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
#~ msgid ""
#~ "<![CDATA[\n"
#~ "</many-to-one>]]>"
#~ msgstr ""
#~ "<![CDATA[\n"
#~ "</many-to-one>]]>"
#~ msgid ""
#~ "<![CDATA["
#~ msgstr ""
#~ "<![CDATA["
Other Hibernate examples (source code examples)
Here is a short list of links related to this Hibernate association_mapping.po source code file:
|