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

Hibernate example source code file (session_api.po)

This example Hibernate source code file (session_api.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

cat, cat, hibernate, hibernate, if, jdbc, les, si, sql, sql, tag, tag, the, this

The Hibernate session_api.po source code

# translation of session_api.po to French
# Myriam Malga <mmalga@redhat.com>, 2007.
# Xi HUANG <xhuang@redhat.com>, 2007.
# Corina Roe <croe@redhat.com>, 2009, 2010.
# translation of Collection_Mapping.po to
msgid ""
msgstr ""
"Project-Id-Version: session_api\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2010-07-21 05:43+0000\n"
"PO-Revision-Date: 2010-01-05 09:57+1000\n"
"Last-Translator: Corina Roe <croe@redhat.com>\n"
"Language-Team: French <i18@redhat.com>\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
#: session_api.xml:31
#, no-c-format
msgid "Working with objects"
msgstr "Travailler avec des objets"

#. Tag: para
#: session_api.xml:33
#, no-c-format
msgid ""
"Hibernate is a full object/relational mapping solution that not only shields "
"the developer from the details of the underlying database management system, "
"but also offers <emphasis>state management of objects. This is, "
"contrary to the management of SQL <literal>statements in common "
"JDBC/SQL persistence layers, a natural object-oriented view of persistence "
"in Java applications."
msgstr ""
"Hibernate est une solution de mappage objet/relationnel complète qui ne "
"masque pas seulement au développeur les détails du système de gestion de "
"base de données sous-jacent, mais offre aussi <emphasis>la gestion d'état SQL dans les couches de persistance "
"habituelles JDBC/SQL, une vue orientée objet très naturelle de la "
"persistance dans les applications Java."

#. Tag: para
#: session_api.xml:40
#, no-c-format
msgid ""
"In other words, Hibernate application developers should always think about "
"the <emphasis>state of their objects, and not necessarily about "
"the execution of SQL statements. This part is taken care of by Hibernate and "
"is only relevant for the application developer when tuning the performance "
"of the system."
msgstr ""
"En d'autres termes, les développeurs d'applications Hibernate devraient "
"toujours réfléchir à <emphasis>l'état de leurs objets, et pas "
"nécessairement à l'exécution des expressions SQL. Cette part est prise en "
"charge par Hibernate et importante seulement aux développeurs d'applications "
"lors du réglage de la performance de leur système."

#. Tag: title
#: session_api.xml:47
#, no-c-format
msgid "Hibernate object states"
msgstr "États des objets Hibernate"

#. Tag: para
#: session_api.xml:49
#, no-c-format
msgid "Hibernate defines and supports the following object states:"
msgstr "Hibernate définit et prend en charge les états d'objets suivants :"

#. Tag: para
#: session_api.xml:53
#, no-c-format
msgid ""
"<emphasis>Transient - an object is transient if it has just been "
"instantiated using the <literal>new operator, and it is not "
"associated with a Hibernate <literal>Session. It has no persistent "
"representation in the database and no identifier value has been assigned. "
"Transient instances will be destroyed by the garbage collector if the "
"application does not hold a reference anymore. Use the Hibernate "
"<literal>Session to make an object persistent (and let Hibernate "
"take care of the SQL statements that need to be executed for this "
"transition)."
msgstr ""
"<emphasis>Éphémère (transient) - un objet est éphémère s'il a "
"juste été instancié en utilisant l'opérateur <literal>new. Il n'a "
"aucune représentation persistante dans la base de données et aucune valeur "
"d'identifiant n'a été assignée. Les instances éphémères seront détruites par "
"le ramasse-miettes si l'application n'en conserve aucune référence. Utilisez "
"la <literal>Session d'Hibernate pour rendre un objet persistant "
"(et laisser Hibernate s'occuper des expressions SQL qui ont besoin d'être "
"exécutées pour cette transistion)."

#. Tag: para
#: session_api.xml:65
#, no-c-format
msgid ""
"<emphasis>Persistent - a persistent instance has a representation "
"in the database and an identifier value. It might just have been saved or "
"loaded, however, it is by definition in the scope of a <literal>Session "
"statements, or <literal>DELETE statements when an object should be "
"made transient."
msgstr ""
"<emphasis>Persistant - une instance persistante a une "
"représentation dans la base de données et une valeur d'identifiant. Elle "
"pourrait avoir juste été sauvegardée ou chargée, pourtant, elle est par "
"définition dans la portée d'une <literal>Session. Hibernate "
"détectera tout changement effectué sur un objet dans l'état persistant et "
"synchronisera l'état avec la base de données lors de la fin de l'unité de "
"travail. Les développeurs n'exécutent pas d'expressions <literal>UPDATEDELETE manuelles lorsqu'un objet devrait être "
"rendu éphémère. "

#. Tag: para
#: session_api.xml:77
#, no-c-format
msgid ""
"<emphasis>Detached - a detached instance is an object that has "
"been persistent, but its <literal>Session has been closed. The "
"reference to the object is still valid, of course, and the detached instance "
"might even be modified in this state. A detached instance can be reattached "
"to a new <literal>Session at a later point in time, making it (and "
"all the modifications) persistent again. This feature enables a programming "
"model for long running units of work that require user think-time. We call "
"them <emphasis>application transactions, i.e., a unit of work "
"from the point of view of the user."
msgstr ""
"<emphasis>Détaché - une instance détachée est un objet qui a été "
"persistant, mais dont la <literal>Session a été fermée. La "
"référence à l'objet est encore valide, bien sûr, et l'instance détachée "
"pourrait même être modifiée dans cet état. Une instance détachée peut être "
"rattachée à une nouvelle <literal>Session ultérieurement, la "
"rendant (et toutes les modifications avec) de nouveau persistante. Cette "
"fonctionnalité rend possible un modèle de programmation pour de longues "
"unités de travail qui requièrent un temps de réflexion de l'utilisateur. "
"Nous les appelons des <emphasis>conversations, c'est-à-dire une "
"unité de travail du point de vue de l'utilisateur. "

#. Tag: para
#: session_api.xml:90
#, no-c-format
msgid ""
"We will now discuss the states and state transitions (and the Hibernate "
"methods that trigger a transition) in more detail."
msgstr ""
"Nous allons maintenant approfondir le sujet des états et des transitions "
"d'état (et des méthodes Hibernate qui déclenchent une transition)."

#. Tag: title
#: session_api.xml:95
#, no-c-format
msgid "Making objects persistent"
msgstr "Rendre des objets persistants"

#. Tag: para
#: session_api.xml:97
#, fuzzy, no-c-format
msgid ""
"Newly instantiated instances of a persistent class are considered "
"<emphasis>transient by Hibernate. We can make a transient "
"instance <emphasis>persistent by associating it with a session:"
msgstr ""
"Les instances nouvellement instanciées d'une classe persistante sont "
"considérées comme <emphasis>éphémères par Hibernate. Nous pouvons "
"rendre une instance éphémère <emphasis>persistante en l'associant "
"à une session :"

#. Tag: programlisting
#: session_api.xml:102
#, no-c-format
msgid ""
"DomesticCat fritz = new DomesticCat();\n"
"fritz.setColor(Color.GINGER);\n"
"fritz.setSex('M');\n"
"fritz.setName(\"Fritz\");\n"
"Long generatedId = (Long) sess.save(fritz);"
msgstr ""

#. Tag: para
#: session_api.xml:104
#, no-c-format
msgid ""
"If <literal>Cat has a generated identifier, the identifier is "
"generated and assigned to the <literal>cat when save()Cat has an assigned instance before calling save()persist() instead of "
"<literal>save(), with the semantics defined in the EJB3 early "
"draft."
msgstr ""
"Si <literal>Cat a un identifiant généré, l'identifiant est généré "
"et assigné au <literal>cat lorsque save() est "
"appelé. Si <literal>Cat a un identifiant assigned avant d'appeler save()persist() à la place "
"de <literal>save(), avec la sémantique définie plus tôt dans la "
"première ébauche d'EJB3. "

#. Tag: para
#: session_api.xml:115
#, no-c-format
msgid ""
"<literal>persist() makes a transient instance persistent. However, "
"it does not guarantee that the identifier value will be assigned to the "
"persistent instance immediately, the assignment might happen at flush time. "
"<literal>persist() also guarantees that it will not execute an "
"<literal>INSERT statement if it is called outside of transaction "
"boundaries. This is useful in long-running conversations with an extended "
"Session/persistence context."
msgstr ""
"<literal>persist() rend une instance éphémère persistante. "
"Toutefois, il ne garantit pas que la valeur d'identificateur soit affectée à "
"l'instance permanente immédiatement, l'affectation peut se produire au "
"moment de flush. <literal>Persist() garantit également qu'il ne "
"s'exécutera pas un énoncé <literal>INSERT s'il est appelée en "
"dehors des limites de transaction. C'est utile pour les longues "
"conversations dans un contexte de session/persistance étendu."

#. Tag: para
#: session_api.xml:126
#, no-c-format
msgid ""
"<literal>save() does guarantee to return an identifier. If an "
"INSERT has to be executed to get the identifier ( e.g. \"identity\" "
"generator, not \"sequence\"), this INSERT happens immediately, no matter if "
"you are inside or outside of a transaction. This is problematic in a long-"
"running conversation with an extended Session/persistence context."
msgstr ""
"<literal>save() garantit le retour d'un identifiant. Si une "
"instruction INSERT doit être exécutée pour obtenir l'identifiant (par "
"exemple,  le générateur \"identity\", et non pas \"sequence\"), cet INSERT "
"se produit immédiatement, que vous soyez à l'intérieur ou à l'extérieur "
"d'une transaction. C'est problématique dans une conversation longue dans un "
"contexte de session/persistance étendu."

#. Tag: para
#: session_api.xml:135
#, no-c-format
msgid ""
"Alternatively, you can assign the identifier using an overloaded version of "
"<literal>save()."
msgstr ""
"Alternativement, vous pouvez assigner l'identifiant en utilisant une version "
"surchargée de <literal>save(). "

#. Tag: programlisting
#: session_api.xml:138
#, no-c-format
msgid ""
"DomesticCat pk = new DomesticCat();\n"
"pk.setColor(Color.TABBY);\n"
"pk.setSex('F');\n"
"pk.setName(\"PK\");\n"
"pk.setKittens( new HashSet() );\n"
"pk.addKitten(fritz);\n"
"sess.save( pk, new Long(1234) );"
msgstr ""

#. Tag: para
#: session_api.xml:140
#, no-c-format
msgid ""
"If the object you make persistent has associated objects (e.g. the "
"<literal>kittens collection in the previous example), these "
"objects can be made persistent in any order you like unless you have a "
"<literal>NOT NULL constraint upon a foreign key column. There is "
"never a risk of violating foreign key constraints. However, you might "
"violate a <literal>NOT NULL constraint if you save() dans l'exemple précédent), ces objets "
"peuvent être rendus persistants dans n'importe quel ordre désiré, à moins "
"que vous ayez une contrainte <literal>NOT NULL sur la colonne de "
"la clé étrangère. Il n'y a jamais de risque de violer une contrainte de cl. "
"étrangère. Cependant, vous pourriez violer une contrainte <literal>NOT NULLsave() sur les objets dans le "
"mauvais ordre. "

#. Tag: para
#: session_api.xml:148
#, no-c-format
msgid ""
"Usually you do not bother with this detail, as you will normally use "
"Hibernate's <emphasis>transitive persistence feature to save the "
"associated objects automatically. Then, even <literal>NOT NULL "
"constraint violations do not occur - Hibernate will take care of everything. "
"Transitive persistence is discussed later in this chapter."
msgstr ""
"Habituellement, vous ne vous préoccupez pas de ce détail, puisque vous "
"utiliserez très probablement la fonctionnalité de <emphasis>persistance "
"transitive</emphasis> de Hibernate pour sauvegarder les objets associés "
"automatiquement. Alors, même les violations de contrainte <literal>NOT NULL methods of Session provide "
"a way of retrieving a persistent instance if you know its identifier. "
"<literal>load() takes a class object and loads the state into a "
"newly instantiated instance of that class in a persistent state."
msgstr ""
"Les méthodes <literal>load() de Session vous "
"donnent un moyen de récupérer une instance persistante si vous connaissez "
"déjà son identifiant. <literal>load() prend un objet de classe et "
"chargera l'état dans une instance nouvellement instanciée de cette classe, "
"dans un état persistant. "

#. Tag: programlisting
#: session_api.xml:165
#, no-c-format
msgid "Cat fritz = (Cat) sess.load(Cat.class, generatedId);"
msgstr ""

#. Tag: programlisting
#: session_api.xml:167
#, no-c-format
msgid ""
"// you need to wrap primitive identifiers\n"
"long id = 1234;\n"
"DomesticCat pk = (DomesticCat) sess.load( DomesticCat.class, new Long(id) );"
msgstr ""

#. Tag: para
#: session_api.xml:169
#, no-c-format
msgid "Alternatively, you can load state into a given instance:"
msgstr ""
"Alternativement, vous pouvez charger un état dans une instance donnée :"

#. Tag: programlisting
#: session_api.xml:171
#, no-c-format
msgid ""
"Cat cat = new DomesticCat();\n"
"// load pk's state into cat\n"
"sess.load( cat, new Long(pkId) );\n"
"Set kittens = cat.getKittens();"
msgstr ""

#. Tag: para
#: session_api.xml:173
#, no-c-format
msgid ""
"Be aware that <literal>load() will throw an unrecoverable "
"exception if there is no matching database row. If the class is mapped with "
"a proxy, <literal>load() just returns an uninitialized proxy and "
"does not actually hit the database until you invoke a method of the proxy. "
"This is useful if you wish to create an association to an object without "
"actually loading it from the database. It also allows multiple instances to "
"be loaded as a batch if <literal>batch-size is defined for the "
"class mapping."
msgstr ""
"Notez que <literal>load() lèvera une exception irrécupérable s'il "
"n'y a pas de ligne correspondante dans la base de données. Si la classe est "
"mappée avec un proxy, <literal>load() retourne juste un proxy non "
"initialisé et n'accède en fait pas à la base de données jusqu'à ce que vous "
"invoquiez une méthode du proxy. Ce comportement est très utile si vous "
"souhaitez créer une association vers un objet sans réellement le charger à "
"partir de la base de données. Cela permet aussi à de multiples instances "
"d'être chargées comme un lot si <literal>batch-size est défini "
"pour le mapping de la classe. "

#. Tag: para
#: session_api.xml:182
#, no-c-format
msgid ""
"If you are not certain that a matching row exists, you should use the "
"<literal>get() method which hits the database immediately and "
"returns null if there is no matching row."
msgstr ""
"Si vous n'êtes pas certain qu'une ligne correspondante existe, vous "
"utiliserez la méthode <literal>get(), laquelle accède à la base de "
"données immédiatement et retourne null s'il n'y a pas de ligne "
"correspondante. "

#. Tag: programlisting
#: session_api.xml:186
#, no-c-format
msgid ""
"Cat cat = (Cat) sess.get(Cat.class, id);\n"
"if (cat==null) {\n"
"    cat = new Cat();\n"
"    sess.save(cat, id);\n"
"}\n"
"return cat;"
msgstr ""

#. Tag: para
#: session_api.xml:188
#, no-c-format
msgid ""
"You can even load an object using an SQL <literal>SELECT ... FOR UPDATELockMode. See the API documentation for "
"more information."
msgstr ""
"Vous pouvez même charger un objet en employant un SQL <literal>SELECT ... "
"FOR UPDATE</literal>, en utilisant un LockMode. Voir la "
"documentation de l'API pour plus d'informations. "

#. Tag: programlisting
#: session_api.xml:192
#, no-c-format
msgid "Cat cat = (Cat) sess.get(Cat.class, id, LockMode.UPGRADE);"
msgstr ""

#. Tag: para
#: session_api.xml:194
#, no-c-format
msgid ""
"Any associated instances or contained collections will <emphasis>notFOR UPDATE, unless you decide to "
"specify <literal>lock or all as a cascade style "
"for the association."
msgstr ""
"Notez que n'importe quelle instance associée ou collection contenue "
"<emphasis>ne sont pas sélectionnées par FOR UPDATElock "
"ou <literal>all en tant que style de cascade pour l'association."

#. Tag: para
#: session_api.xml:199
#, no-c-format
msgid ""
"It is possible to re-load an object and all its collections at any time, "
"using the <literal>refresh() method. This is useful when database "
"triggers are used to initialize some of the properties of the object."
msgstr ""
"Il est possible de re-charger un objet et toutes ses collections à tout "
"moment, en utilisant la méthode <literal>refresh(). C'est utile "
"lorsque des \"triggers\" de base de données sont utilisés pour initialiser "
"certaines propriétés de l'objet."

#. Tag: programlisting
#: session_api.xml:204
#, no-c-format
msgid ""
"sess.save(cat);\n"
"sess.flush(); //force the SQL INSERT\n"
"sess.refresh(cat); //re-read the state (after the trigger executes)"
msgstr ""

#. Tag: para
#: session_api.xml:206
#, fuzzy, no-c-format
msgid ""
"How much does Hibernate load from the database and how many SQL "
"<literal>SELECTs will it use? This depends on the "
"<emphasis>fetching strategy. This is explained in s utilisera-t-il ? Cela dépend de la "
"<emphasis>stratégie de récupération et cela est expliqué dans "
"<xref linkend=\"performance-fetching\" />."

#. Tag: title
#: session_api.xml:213
#, no-c-format
msgid "Querying"
msgstr "Requêtage"

#. Tag: para
#: session_api.xml:215
#, no-c-format
msgid ""
"If you do not know the identifiers of the objects you are looking for, you "
"need a query. Hibernate supports an easy-to-use but powerful object oriented "
"query language (HQL). For programmatic query creation, Hibernate supports a "
"sophisticated Criteria and Example query feature (QBC and QBE). You can also "
"express your query in the native SQL of your database, with optional support "
"from Hibernate for result set conversion into objects."
msgstr ""
"Si vous ne connaissez par les identifiants des objets que vous recherchez, "
"vous avez besoin d'une requête. Hibernate supporte un langage de requêtes "
"orientées objet, facile à utiliser mais puissant. Pour la création de "
"requêtes par programmation, Hibernate supporte une fonction de requêtage "
"sophistiquée Criteria et Example (QBC et QBE). Vous pouvez aussi exprimer "
"votre requête dans le SQL natif de votre base de données, avec un support "
"optionnel de Hibernate pour la conversion des ensembles de résultats en "
"objets. "

#. Tag: title
#: session_api.xml:224
#, no-c-format
msgid "Executing queries"
msgstr "Exécution de requêtes"

#. Tag: para
#: session_api.xml:226
#, no-c-format
msgid ""
"HQL and native SQL queries are represented with an instance of <literal>org."
"hibernate.Query</literal>. This interface offers methods for parameter "
"binding, result set handling, and for the execution of the actual query. You "
"always obtain a <literal>Query using the current Session. L'interface offre des méthodes pour "
"la liaison des paramètres, la gestion des ensembles de résultats, et pour "
"l'exécution de la requête réelle. Vous obtenez toujours une <literal>QuerySession courante : "

#. Tag: programlisting
#: session_api.xml:232
#, no-c-format
msgid ""
"List cats = session.createQuery(\n"
"    \"from Cat as cat where cat.birthdate < ?\")\n"
"    .setDate(0, date)\n"
"    .list();\n"
"\n"
"List mothers = session.createQuery(\n"
"    \"select mother from Cat as cat join cat.mother as mother where cat.name "
"= ?\")\n"
"    .setString(0, name)\n"
"    .list();\n"
"\n"
"List kittens = session.createQuery(\n"
"    \"from Cat as cat where cat.mother = ?\")\n"
"    .setEntity(0, pk)\n"
"    .list();\n"
"\n"
"Cat mother = (Cat) session.createQuery(\n"
"    \"select cat.mother from Cat as cat where cat = ?\")\n"
"    .setEntity(0, izi)\n"
"    .uniqueResult();]]\n"
"\n"
"Query mothersWithKittens = (Cat) session.createQuery(\n"
"    \"select mother from Cat as mother left join fetch mother.kittens\");\n"
"Set uniqueMothers = new HashSet(mothersWithKittens.list());"
msgstr ""

#. Tag: para
#: session_api.xml:234
#, no-c-format
msgid ""
"A query is usually executed by invoking <literal>list(). The "
"result of the query will be loaded completely into a collection in memory. "
"Entity instances retrieved by a query are in a persistent state. The "
"<literal>uniqueResult() method offers a shortcut if you know your "
"query will only return a single object. Queries that make use of eager "
"fetching of collections usually return duplicates of the root objects, but "
"with their collections initialized. You can filter these duplicates through "
"a <literal>Set."
msgstr ""
"Une requête est généralement exécutée en invoquant <literal>list() "
"offre un raccourci si vous savez que votre requête retournera un seul objet. "
"Notez que les requêtes qui utilisent le chargement agressif de collections "
"retournent habituellement des copies des objets racine (mais avec leurs "
"collections initialisées). Vous pouvez simplement filtrer ces copies via un "
"<literal>Set. "

#. Tag: title
#: session_api.xml:244
#, no-c-format
msgid "Iterating results"
msgstr "Itération de résultats"

#. Tag: para
#: session_api.xml:246
#, no-c-format
msgid ""
"Occasionally, you might be able to achieve better performance by executing "
"the query using the <literal>iterate() method. This will usually "
"be the case if you expect that the actual entity instances returned by the "
"query will already be in the session or second-level cache. If they are not "
"already cached, <literal>iterate() will be slower than "
"<literal>list() and might require many database hits for a simple "
"query, usually <emphasis>1 for the initial select which only "
"returns identifiers, and <emphasis>n additional selects to "
"initialize the actual instances."
msgstr ""
"Parfois, vous serez en mesure d'obtenir de meilleures performances en "
"exécutant la requête avec la méthode <literal>iterate(). En "
"général, ce sera uniquement le cas si vous attendez que les instances "
"réelles d'entité retournées par la requête, soient déjà chargées dans la "
"session ou le cache de second niveau. Si elles ne sont pas déjà cachées, "
"<literal>iterate() sera plus lent que list() et "
"pourrait nécessiter plusieurs accès à la base de données pour une simple "
"requête, généralement <emphasis>1 pour le select initial qui "
"retourne seulement les identifiants, et <emphasis>n selects "
"supplémentaires pour initialiser les instances réelles. "

#. Tag: programlisting
#: session_api.xml:257
#, no-c-format
msgid ""
"// fetch ids\n"
"Iterator iter = sess.createQuery(\"from eg.Qux q order by q.likeliness\")."
"iterate();\n"
"while ( iter.hasNext() ) {\n"
"    Qux qux = (Qux) iter.next();  // fetch the object\n"
"    // something we couldnt express in the query\n"
"    if ( qux.calculateComplicatedAlgorithm() ) {\n"
"        // delete the current instance\n"
"        iter.remove();\n"
"        // dont need to process the rest\n"
"        break;\n"
"    }\n"
"}"
msgstr ""

#. Tag: title
#: session_api.xml:261
#, no-c-format
msgid "Queries that return tuples"
msgstr "Requêtes qui retournent des tuples"

#. Tag: para
#: session_api.xml:263
#, no-c-format
msgid ""
"Hibernate queries sometimes return tuples of objects. Each tuple is returned "
"as an array:"
msgstr ""
"Les requêtes d'Hibernate retournent parfois des tuples d'objets, auquel cas "
"chaque tuple est retourné comme un tableau : "

#. Tag: programlisting
#: session_api.xml:266
#, no-c-format
msgid ""
"Iterator kittensAndMothers = sess.createQuery(\n"
"            \"select kitten, mother from Cat kitten join kitten.mother mother"
"\")\n"
"            .list()\n"
"            .iterator();\n"
"\n"
"while ( kittensAndMothers.hasNext() ) {\n"
"    Object[] tuple = (Object[]) kittensAndMothers.next();\n"
"    Cat kitten = (Cat) tuple[0];\n"
"    Cat mother = (Cat) tuple[1];\n"
"    ....\n"
"}"
msgstr ""

#. Tag: title
#: session_api.xml:270
#, no-c-format
msgid "Scalar results"
msgstr "Résultats scalaires"

#. Tag: para
#: session_api.xml:272
#, no-c-format
msgid ""
"Queries can specify a property of a class in the <literal>select "
"clause. They can even call SQL aggregate functions. Properties or aggregates "
"are considered \"scalar\" results and not entities in persistent state."
msgstr ""
"Certaines requêtes peuvent spécifier une propriété de classe dans la clause "
"<literal>select. Elles peuvent même appeler des fonctions "
"d'aggrégat SQL. Les propriétés ou les aggrégats sont considérés comme des "
"résultats \"scalaires\" (et non des entités dans un état persistant). "

#. Tag: programlisting
#: session_api.xml:277
#, no-c-format
msgid ""
"Iterator results = sess.createQuery(\n"
"        \"select cat.color, min(cat.birthdate), count(cat) from Cat cat \" "
"+\n"
"        \"group by cat.color\")\n"
"        .list()\n"
"        .iterator();\n"
"\n"
"while ( results.hasNext() ) {\n"
"    Object[] row = (Object[]) results.next();\n"
"    Color type = (Color) row[0];\n"
"    Date oldest = (Date) row[1];\n"
"    Integer count = (Integer) row[2];\n"
"    .....\n"
"}"
msgstr ""

#. Tag: title
#: session_api.xml:281
#, no-c-format
msgid "Bind parameters"
msgstr "Lier des paramètres"

#. Tag: para
#: session_api.xml:283
#, no-c-format
msgid ""
"Methods on <literal>Query are provided for binding values to named "
"parameters or JDBC-style <literal>? parameters. Contrary "
"to JDBC, Hibernate numbers parameters from zero.</emphasis> Named parameters "
"are identifiers of the form <literal>:name in the query string. "
"The advantages of named parameters are as follows:"
msgstr ""
"Des méthodes de <literal>Query sont fournies pour lier des valeurs "
"à des paramètres nommés ou à des paramètres de style JDBC <literal>?Contrairement à JDBC, les numéros des paramètres de "
"Hibernate commencent à zéro.</emphasis> Les paramètres nommés sont des "
"identifiants de la forme <literal>:nom dans la chaîne de "
"caractères de la requête. Les avantages des paramètres nommés sont : "

#. Tag: para
#: session_api.xml:292
#, no-c-format
msgid ""
"named parameters are insensitive to the order they occur in the query string"
msgstr ""
"les paramètres nommés sont insensibles à l'ordre dans lequel ils "
"apparaissent dans la chaîne de la requête"

#. Tag: para
#: session_api.xml:297
#, no-c-format
msgid "they can occur multiple times in the same query"
msgstr "ils peuvent apparaître plusieurs fois dans la même requête "

#. Tag: para
#: session_api.xml:301
#, no-c-format
msgid "they are self-documenting"
msgstr "ils sont auto-documentés"

#. Tag: programlisting
#: session_api.xml:305
#, no-c-format
msgid ""
"//named parameter (preferred)\n"
"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = :name"
"\");\n"
"q.setString(\"name\", \"Fritz\");\n"
"Iterator cats = q.iterate();"
msgstr ""

#. Tag: programlisting
#: session_api.xml:307
#, no-c-format
msgid ""
"//positional parameter\n"
"Query q = sess.createQuery(\"from DomesticCat cat where cat.name = ?\");\n"
"q.setString(0, \"Izi\");\n"
"Iterator cats = q.iterate();"
msgstr ""

#. Tag: programlisting
#: session_api.xml:309
#, no-c-format
msgid ""
"//named parameter list\n"
"List names = new ArrayList();\n"
"names.add(\"Izi\");\n"
"names.add(\"Fritz\");\n"
"Query q = sess.createQuery(\"from DomesticCat cat where cat.name in (:"
"namesList)\");\n"
"q.setParameterList(\"namesList\", names);\n"
"List cats = q.list();"
msgstr ""

#. Tag: title
#: session_api.xml:313
#, no-c-format
msgid "Pagination"
msgstr "Pagination"

#. Tag: para
#: session_api.xml:315
#, no-c-format
msgid ""
"If you need to specify bounds upon your result set, that is, the maximum "
"number of rows you want to retrieve and/or the first row you want to "
"retrieve, you can use methods of the <literal>Query interface:"
msgstr ""
"Si vous avez besoin de spécifier des liens sur votre ensemble de résultats "
"(le nombre maximum de lignes et/ou la première ligne que vous voulez "
"récupérer) vous utiliserez des méthodes de l'interface <literal>Querys, the "
"<literal>Query interface can be used to obtain a "
"<literal>ScrollableResults object that allows flexible navigation "
"of the query results."
msgstr ""
"Si votre connecteur JDBC supporte les <literal>ResultSet s "
"\"scrollables\", l'interface <literal>Query peut être utilisée "
"pour obtenir un objet <literal>ScrollableResults, qui permettra "
"une navigation flexible dans les résultats de la requête. "

#. Tag: programlisting
#: session_api.xml:334
#, no-c-format
msgid ""
"Query q = sess.createQuery(\"select cat.name, cat from DomesticCat cat \" +\n"
"                            \"order by cat.name\");\n"
"ScrollableResults cats = q.scroll();\n"
"if ( cats.first() ) {\n"
"\n"
"    // find the first name on each page of an alphabetical list of cats by "
"name\n"
"    firstNamesOfPages = new ArrayList();\n"
"    do {\n"
"        String name = cats.getString(0);\n"
"        firstNamesOfPages.add(name);\n"
"    }\n"
"    while ( cats.scroll(PAGE_SIZE) );\n"
"\n"
"    // Now get the first page of cats\n"
"    pageOfCats = new ArrayList();\n"
"    cats.beforeFirst();\n"
"    int i=0;\n"
"    while( ( PAGE_SIZE > i++ ) && cats.next() ) pageOfCats.add"
"( cats.get(1) );\n"
"\n"
"}\n"
"cats.close()"
msgstr ""

#. Tag: para
#: session_api.xml:336
#, no-c-format
msgid ""
"Note that an open database connection and cursor is required for this "
"functionality. Use <literal>setMaxResult()/setFirstResult"
"()</literal> if you need offline pagination functionality."
msgstr ""
"Notez qu'une connexion ouverte (et un curseur) est requise pour cette "
"fonctionnalité, utilisez <literal>setMaxResult()/"
"<literal>setFirstResult() si vous avez besoin d'une fonctionnalité "
"de pagination hors ligne. "

#. Tag: title
#: session_api.xml:343
#, no-c-format
msgid "Externalizing named queries"
msgstr "Externaliser des requêtes nommées"

#. Tag: para
#: session_api.xml:345
#, no-c-format
msgid ""
"Queries can also be configured as so called named queries using annotations "
"or Hibernate mapping documents. <literal>@NamedQuery and "
"<literal>@NamedQueries can be defined at the class level as seen "
"in <xref linkend=\"example-named-query-annotation\"/> . However their "
"definitions are global to the session factory/entity manager factory scope. "
"A named query is defined by its name and the actual query string."
msgstr ""

#. Tag: title
#: session_api.xml:355
#, no-c-format
msgid "Defining a named query using <classname>@NamedQuery"
msgstr ""

#. Tag: programlisting
#: session_api.xml:358
#, no-c-format
msgid ""
"@Entity\n"
"@NamedQuery(name=\"night.moreRecentThan\", query=\"select n from Night n "
"where n.date >= :date\")\n"
"public class Night {\n"
"    ...\n"
"}\n"
"\n"
"public class MyDao {\n"
"    doStuff() {\n"
"        Query q = s.getNamedQuery(\"night.moreRecentThan\");\n"
"        q.setDate( \"date\", aMonthAgo );\n"
"        List results = q.list();\n"
"        ...\n"
"    }\n"
"    ...\n"
"}"
msgstr ""

#. Tag: para
#: session_api.xml:361
#, fuzzy, no-c-format
msgid ""
"Using a mapping document can be configured using the <literal><query>CDATA section if your "
"query contains characters that could be interpreted as markup."
msgstr ""
"Vous pouvez aussi définir des requêtes nommées dans le document de mapping. "
"Souvenez-vous d'utiliser une section <literal>CDATA si votre "
"requête contient des caractères qui pourraient être interprétés comme des "
"éléments XML."

#. Tag: title
#: session_api.xml:367
#, no-c-format
msgid "Defining a named query using <literal><query>"
msgstr ""

#. Tag: programlisting
#: session_api.xml:370
#, no-c-format
msgid ""
"<query name=\"ByNameAndMaximumWeight\"><![CDATA[\n"
"    from eg.DomesticCat as cat\n"
"        where cat.name = ?\n"
"        and cat.weight > ?\n"
"] ]></query>"
msgstr ""

#. Tag: para
#: session_api.xml:373
#, fuzzy, no-c-format
msgid ""
"Parameter binding and executing is done programatically as seen in <xref "
"linkend=\"example-parameter-binding-named-query\"/>."
msgstr ""
"La liaison de paramètres et l'exécution sont effectués par programmation :"

#. Tag: title
#: session_api.xml:377
#, no-c-format
msgid "Parameter binding of a named query"
msgstr ""

#. Tag: programlisting
#: session_api.xml:379
#, no-c-format
msgid ""
"Query q = sess.getNamedQuery(\"ByNameAndMaximumWeight\");\n"
"q.setString(0, name);\n"
"q.setInt(1, minWeight);\n"
"List cats = q.list();"
msgstr ""

#. Tag: para
#: session_api.xml:382
#, no-c-format
msgid ""
"The actual program code is independent of the query language that is used. "
"You can also define native SQL queries in metadata, or migrate existing "
"queries to Hibernate by placing them in mapping files."
msgstr ""
"Notez que le code réel du programme est indépendant du langage de requête "
"utilisé, vous pouvez aussi définir des requêtes SQL natives dans les méta-"
"données, ou migrer des requêtes existantes vers Hibernate en les plaçant "
"dans les fichiers de mapping. "

#. Tag: para
#: session_api.xml:387
#, no-c-format
msgid ""
"Also note that a query declaration inside a <literal><hibernate-"
"mapping></literal> element requires a global unique name for the query, "
"while a query declaration inside a <literal><class> element "
"is made unique automatically by prepending the fully qualified name of the "
"class. For example <literal>eg.Cat.ByNameAndMaximumWeight."
msgstr ""
"Notez aussi que la déclaration d'une requête dans un élément <literal><"
"hibernate-mapping></literal> nécessite un nom globalement unique pour la "
"requête, alors que la déclaration d'une requête dans un élément <literal><"
"class></literal> est rendue unique de manière automatique par la mise en "
"préfixe du nom entièrement qualifié de la classe, par exemple <literal>eg."
"Cat.ByNameAndMaximumWeight</literal>. "

#. Tag: title
#: session_api.xml:397
#, no-c-format
msgid "Filtering collections"
msgstr "Filtrer des collections"

#. Tag: para
#: session_api.xml:399
#, no-c-format
msgid ""
"A collection <emphasis>filter is a special type of query that can "
"be applied to a persistent collection or array. The query string can refer "
"to <literal>this, meaning the current collection element."
msgstr ""
"Un <emphasis>filtre de collection est un type spécial de requête "
"qui peut être appliqué à une collection persistante ou à un tableau. La "
"chaîne de requêtes peut se référer à <literal>this, correspondant "
"à l'élément de la collection courant. "

#. Tag: programlisting
#: session_api.xml:404
#, no-c-format
msgid ""
"Collection blackKittens = session.createFilter(\n"
"    pk.getKittens(), \n"
"    \"where this.color = ?\")\n"
"    .setParameter( Color.BLACK, Hibernate.custom(ColorUserType.class) )\n"
"    .list()\n"
");"
msgstr ""

#. Tag: para
#: session_api.xml:406
#, no-c-format
msgid ""
"The returned collection is considered a bag that is a copy of the given "
"collection. The original collection is not modified. This is contrary to the "
"implication of the name \"filter\", but consistent with expected behavior."
msgstr ""
"La collection retournée est considérée comme un bag, et c'est une copie de "
"la collection donnée. La collection originale n'est pas modifiée. C'est "
"contraire à l'implication du nom \"filtre\"; mais cohérent avec le "
"comportement attendu."

#. Tag: para
#: session_api.xml:411
#, no-c-format
msgid ""
"Observe that filters do not require a <literal>from clause, "
"although they can have one if required. Filters are not limited to returning "
"the collection elements themselves."
msgstr ""
"Observez que les filtres ne nécessitent pas une clause <literal>from query "
"API for these cases:"
msgstr ""
"HQL est extrêmement puissant, mais certains développeurs préfèrent "
"construire des requêtes dynamiquement, en utilisant l'API orientée objet, "
"plutôt que de construire des chaînes de requêtes. Hibernate fournit une API "
"intuitive de requête <literal>Criteria pour ces cas :"

#. Tag: programlisting
#: session_api.xml:431
#, no-c-format
msgid ""
"Criteria crit = session.createCriteria(Cat.class);\n"
"crit.add( Restrictions.eq( \"color\", eg.Color.BLACK ) );\n"
"crit.setMaxResults(10);\n"
"List cats = crit.list();"
msgstr ""

#. Tag: para
#: session_api.xml:433
#, fuzzy, no-c-format
msgid ""
"The <literal>Criteria and the associated Example et l'APIExample associé "
"sont traités plus en détail dans <xref linkend=\"querycriteria\" />."

#. Tag: title
#: session_api.xml:439
#, no-c-format
msgid "Queries in native SQL"
msgstr "Requêtes en SQL natif"

#. Tag: para
#: session_api.xml:441
#, no-c-format
msgid ""
"You can express a query in SQL, using <literal>createSQLQuery() "
"and let Hibernate manage the mapping from result sets to objects. You can at "
"any time call <literal>session.connection() and use the JDBC "
"<literal>Connection directly. If you choose to use the Hibernate "
"API, you must enclose SQL aliases in braces:"
msgstr ""
"Vous pouvez exprimer une requête en SQL, en utilisant <literal>createSQLQuery"
"()</literal> et laisser Hibernate s'occuper du mappage des résultats vers "
"des objets. Notez que vous pouvez à tout moment, appeler <literal>session."
"connection()</literal> et utiliser directement la Connection (i.e. objects "
"loaded, saved, created or queried by the <literal>Session) can be "
"manipulated by the application, and any changes to persistent state will be "
"persisted when the <literal>Session is flushed, which has a different "
"purpose) to make your modifications persistent. The most straightforward way "
"to update the state of an object is to <literal>load() it and then "
"manipulate it directly while the <literal>Session is open:"
msgstr ""
"Les <emphasis>instances persistantes transactionnelles (c'est-à-"
"dire des objets chargés, sauvegardés, créés ou requêtés par la "
"<literal>Session) peuvent être manipulés par l'application et tout "
"changement vers l'état persistant sera persisté lorsque la <literal>Session\"flushée\" (traité plus tard dans ce "
"chapitre). Il n'est pas nécessaire d'appeler une méthode particulière (comme "
"<literal>update(), qui a un but différent) pour rendre vos "
"modifications persistantes. Donc la manière la plus directe de mettre à jour "
"l'état d'un objet est de le charger avec <literal>load(), et puis "
"de le manipuler directement, tant que la <literal>Session est "
"ouverte : "

#. Tag: programlisting
#: session_api.xml:473
#, no-c-format
msgid ""
"DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );\n"
"cat.setName(\"PK\");\n"
"sess.flush();  // changes to cat are automatically detected and persisted"
msgstr ""

#. Tag: para
#: session_api.xml:475
#, no-c-format
msgid ""
"Sometimes this programming model is inefficient, as it requires in the same "
"session both an SQL <literal>SELECT to load an object and an SQL "
"<literal>UPDATE to persist its updated state. Hibernate offers an "
"alternate approach by using detached instances."
msgstr ""
"Parfois ce modèle de programmation est inefficace puisqu'il nécessiterait un "
"SQL <literal>SELECT (pour charger l'objet) et un SQL "
"<literal>UPDATE (pour persister son état mis à jour) dans la même "
"session. Ainsi Hibernate offre une autre approche, en utilisant des "
"instances détachées. "

#. Tag: title
#: session_api.xml:483
#, no-c-format
msgid "Modifying detached objects"
msgstr "Modifier des objets détachés"

#. Tag: para
#: session_api.xml:485
#, no-c-format
msgid ""
"Many applications need to retrieve an object in one transaction, send it to "
"the UI layer for manipulation, then save the changes in a new transaction. "
"Applications that use this kind of approach in a high-concurrency "
"environment usually use versioned data to ensure isolation for the \"long\" "
"unit of work."
msgstr ""
"Beaucoup d'applications ont besoin de récupérer un objet dans une "
"transaction, de l'envoyer à la couche interfacée avec l'utilisateur pour les "
"manipulations, et de sauvegarder les changements dans une nouvelle "
"transaction. Les applications qui utilisent cette approche dans un "
"environnement à haute concurrence utilisent généralement des données "
"versionnées pour assurer l'isolation des \"longues\" unités de travail."

#. Tag: para
#: session_api.xml:491
#, no-c-format
msgid ""
"Hibernate supports this model by providing for reattachment of detached "
"instances using the <literal>Session.update() or Session."
"merge()</literal> methods:"
msgstr ""
"Hibernate supporte ce modèle en permettant pour le rattachement d'instances "
"détachées en utilisant des méthodes <literal>Session.update() ou "
"<literal>Session.merge() :"

#. Tag: programlisting
#: session_api.xml:495
#, no-c-format
msgid ""
"// in the first session\n"
"Cat cat = (Cat) firstSession.load(Cat.class, catId);\n"
"Cat potentialMate = new Cat();\n"
"firstSession.save(potentialMate);\n"
"\n"
"// in a higher layer of the application\n"
"cat.setMate(potentialMate);\n"
"\n"
"// later, in a new session\n"
"secondSession.update(cat);  // update cat\n"
"secondSession.update(mate); // update mate"
msgstr ""

#. Tag: para
#: session_api.xml:497
#, no-c-format
msgid ""
"If the <literal>Cat with identifier catId had "
"already been loaded by <literal>secondSession when the application "
"tried to reattach it, an exception would have been thrown."
msgstr ""
"Si le <literal>Cat avec l'identifiant catId "
"avait déjà été chargé par <literal>secondSession lorsque "
"l'application a essayé de le rattacher, une exception aurait été levée."

#. Tag: para
#: session_api.xml:502
#, no-c-format
msgid ""
"Use <literal>update() if you are certain that the session does not "
"contain an already persistent instance with the same identifier. Use "
"<literal>merge() if you want to merge your modifications at any "
"time without consideration of the state of the session. In other words, "
"<literal>update() is usually the first method you would call in a "
"fresh session, ensuring that the reattachment of your detached instances is "
"the first operation that is executed."
msgstr ""
"Utilisez <literal>update() si vous êtes sûr que la session ne "
"contient pas déjà une instance persistante avec le même identifiant, et "
"<literal>merge() si vous voulez fusionner vos modifications "
"n'importe quand sans considérer l'état de la session. En d'autres termes, "
"<literal>update() est généralement la première méthode que vous "
"devez appeler dans une session fraîche, pour vous assurer que le "
"rattachement de vos instances détachées est la première opération qui est "
"exécutée. "

#. Tag: para
#: session_api.xml:510
#, fuzzy, no-c-format
msgid ""
"The application should individually <literal>update() detached "
"instances that are reachable from the given detached instance "
"<emphasis>only if it wants their state to be updated. This can be "
"automated using <emphasis>transitive persistence. See  (NdT : "
"mettre à jour) les instances détachées accessibles depuis l'instance "
"détachée donnée si et <emphasis>seulement si elle veut que leur "
"état soit aussi mis à jour. Ceci peut être automatisé bien sûr, en utilisant "
"la <emphasis>persistance transitive. Voir  method also allows an application to "
"reassociate an object with a new session. However, the detached instance has "
"to be unmodified."
msgstr ""
"La méthode <literal>lock() permet aussi à une application de ré-"
"associer un objet avec une nouvelle session. Cependant, l'instance détachée "
"doit être non modifiée."

#. Tag: programlisting
#: session_api.xml:520
#, no-c-format
msgid ""
"//just reassociate:\n"
"sess.lock(fritz, LockMode.NONE);\n"
"//do a version check, then reassociate:\n"
"sess.lock(izi, LockMode.READ);\n"
"//do a version check, using SELECT ... FOR UPDATE, then reassociate:\n"
"sess.lock(pk, LockMode.UPGRADE);"
msgstr ""

#. Tag: para
#: session_api.xml:522
#, no-c-format
msgid ""
"Note that <literal>lock() can be used with various "
"<literal>LockModes. See the API documentation and the chapter on "
"transaction handling for more information. Reattachment is not the only "
"usecase for <literal>lock()."
msgstr ""
"Notez que <literal>lock() peut être utilisé avec différents "
"<literal>LockMode s, voir la documentation de l'API et le chapitre "
"sur la gestion des transactions pour plus d'informations. Le rattachement "
"n'est pas le seul cas d'utilisation pour <literal>lock(). "

#. Tag: para
#: session_api.xml:527
#, fuzzy, no-c-format
msgid ""
"Other models for long units of work are discussed in <xref linkend="
"\"transactions-optimistic\"/>."
msgstr ""
"D'autres modèles pour de longues unités de travail sont traités dans <xref "
"linkend=\"transactions-optimistic\" />."

#. Tag: title
#: session_api.xml:532
#, no-c-format
msgid "Automatic state detection"
msgstr "Détection automatique d'un état"

#. Tag: para
#: session_api.xml:534
#, no-c-format
msgid ""
"Hibernate users have requested a general purpose method that either saves a "
"transient instance by generating a new identifier or updates/reattaches the "
"detached instances associated with its current identifier. The "
"<literal>saveOrUpdate() method implements this functionality."
msgstr ""
"Les utilisateurs d'Hibernate ont demandé une méthode dont l'intention "
"générale serait soit de sauvegarder une instance éphémère en générant un "
"nouvel identifiant, soit mettre à jour/rattacher les instances détachées "
"associées à l'identifiant courant. La méthode <literal>saveOrUpdate() seems to be "
"confusing for new users. Firstly, so long as you are not trying to use "
"instances from one session in another new session, you should not need to "
"use <literal>update(), saveOrUpdate(), or "
"<literal>merge(). Some whole applications will never use either of "
"these methods."
msgstr ""
"L'usage et la sémantique de <literal>saveOrUpdate() semble être "
"confuse pour les nouveaux utilisateurs. Premièrement, aussi longtemps que "
"vous n'essayez pas d'utiliser des instances d'une session dans une autre, "
"vous ne devriez pas avoir besoin d'utiliser <literal>update(), "
"<literal>saveOrUpdate(), ou merge(). Certaines "
"applications n'utiliseront jamais ces méthodes."

#. Tag: para
#: session_api.xml:549
#, no-c-format
msgid ""
"Usually <literal>update() or saveOrUpdate() are "
"used in the following scenario:"
msgstr ""
"Généralement <literal>update() ou saveOrUpdate() does the following:"
msgstr "<literal>saveOrUpdate() s'utilise dans le cas suivant :"

#. Tag: para
#: session_api.xml:580
#, no-c-format
msgid "if the object is already persistent in this session, do nothing"
msgstr "si l'objet est déjà persistant dans cette session, ne rien faire"

#. Tag: para
#: session_api.xml:585
#, no-c-format
msgid ""
"if another object associated with the session has the same identifier, throw "
"an exception"
msgstr ""
"si un autre objet associé à la session a le même identifiant, lever une "
"exception"

#. Tag: para
#: session_api.xml:590
#, no-c-format
msgid "if the object has no identifier property, <literal>save() it"
msgstr ""
"si l'objet n'a pas de propriété d'identifiant, appeler <literal>save() it"
msgstr ""
"si l'identifiant de l'objet a une valeur assignée à un objet nouvellement "
"instancié, appeler <literal>save()"

#. Tag: para
#: session_api.xml:600
#, no-c-format
msgid ""
"if the object is versioned by a <literal><version> or "
"<literal><timestamp>, and the version property value is the "
"same value assigned to a newly instantiated object, <literal>save() ou "
"<literal><timestamp>), et la valeur de la propriété de "
"version est la même valeur que celle assignée à un objet nouvellement "
"instancié, appeler <literal>save() "

#. Tag: para
#: session_api.xml:608
#, no-c-format
msgid "otherwise <literal>update() the object"
msgstr "sinon mettre à jour l'objet avec <literal>update()"

#. Tag: para
#: session_api.xml:612
#, no-c-format
msgid "and <literal>merge() is very different:"
msgstr "et <literal>merge() est très différent :"

#. Tag: para
#: session_api.xml:616
#, no-c-format
msgid ""
"if there is a persistent instance with the same identifier currently "
"associated with the session, copy the state of the given object onto the "
"persistent instance"
msgstr ""
"s'il y a une instance persistante avec le même identifiant couramment "
"associé à la session, copier l'état de l'objet donné dans l'instance "
"persistante"

#. Tag: para
#: session_api.xml:622
#, no-c-format
msgid ""
"if there is no persistent instance currently associated with the session, "
"try to load it from the database, or create a new persistent instance"
msgstr ""
"s'il n'y a pas d'instance persistante associée à cette session, essayer de "
"le charger à partir de la base de données, ou créer une nouvelle instance "
"persistante"

#. Tag: para
#: session_api.xml:628
#, no-c-format
msgid "the persistent instance is returned"
msgstr "l'instance persistante est retournée"

#. Tag: para
#: session_api.xml:632
#, no-c-format
msgid ""
"the given instance does not become associated with the session, it remains "
"detached"
msgstr ""
"l'instance donnée ne devient pas associée à la session, elle reste détachée"

#. Tag: title
#: session_api.xml:639
#, no-c-format
msgid "Deleting persistent objects"
msgstr "Suppression d'objets persistants"

#. Tag: para
#: session_api.xml:641
#, no-c-format
msgid ""
"<literal>Session.delete() will remove an object's state from the "
"database. Your application, however, can still hold a reference to a deleted "
"object. It is best to think of <literal>delete() as making a "
"persistent instance, transient."
msgstr ""
"<literal>Session.delete() supprimera l'état d'un objet de la base "
"de données. Bien sûr, votre application pourrait encore conserver une "
"référence vers un objet effacé. Il est préférable de penser à <literal>delete"
"()</literal> comme rendant une instance persistante éphémère. "

#. Tag: programlisting
#: session_api.xml:646
#, no-c-format
msgid "sess.delete(cat);"
msgstr ""

#. Tag: para
#: session_api.xml:648
#, no-c-format
msgid ""
"You can delete objects in any order, without risk of foreign key constraint "
"violations. It is still possible to violate a <literal>NOT NULL "
"constraint on a foreign key column by deleting objects in the wrong order, e."
"g. if you delete the parent, but forget to delete the children."
msgstr ""
"Vous pouvez effacer des objets dans l'ordre que vous voulez, sans risque de "
"violations de contrainte de clef étrangère. Il est encore possible de violer "
"une contrainte <literal>NOT NULL sur une colonne de clef étrangère "
"en effaçant des objets dans le mauvais ordre, par exemple si vous effacez le "
"parent, mais oubliez d'effacer les enfants. "

#. Tag: title
#: session_api.xml:656
#, no-c-format
msgid "Replicating object between two different datastores"
msgstr "Réplication d'objets entre deux entrepôts de données"

#. Tag: para
#: session_api.xml:658
#, no-c-format
msgid ""
"It is sometimes useful to be able to take a graph of persistent instances "
"and make them persistent in a different datastore, without regenerating "
"identifier values."
msgstr ""
"Il est occasionnellement utile de pouvoir prendre un graphe d'instances "
"persistantes et de les rendre persistantes dans un entrepôt différent, sans "
"regénérer les valeurs des identifiants. "

#. Tag: programlisting
#: session_api.xml:662
#, no-c-format
msgid ""
"//retrieve a cat from one database\n"
"Session session1 = factory1.openSession();\n"
"Transaction tx1 = session1.beginTransaction();\n"
"Cat cat = session1.get(Cat.class, catId);\n"
"tx1.commit();\n"
"session1.close();\n"
"\n"
"//reconcile with a second database\n"
"Session session2 = factory2.openSession();\n"
"Transaction tx2 = session2.beginTransaction();\n"
"session2.replicate(cat, ReplicationMode.LATEST_VERSION);\n"
"tx2.commit();\n"
"session2.close();"
msgstr ""

#. Tag: para
#: session_api.xml:664
#, no-c-format
msgid ""
"The <literal>ReplicationMode determines how replicate() détermine comment replicate()"
"</literal> traitera les conflits avec des lignes existantes dans la base de "
"données. "

#. Tag: para
#: session_api.xml:670
#, no-c-format
msgid ""
"<literal>ReplicationMode.IGNORE: ignores the object when there is "
"an existing database row with the same identifier"
msgstr ""
"<literal>ReplicationMode.IGNORE - ignore l'objet s'il y a une "
"ligne existante dans la base de données avec le même identifiant "

#. Tag: para
#: session_api.xml:675
#, no-c-format
msgid ""
"<literal>ReplicationMode.OVERWRITE: overwrites any existing "
"database row with the same identifier"
msgstr ""
"<literal>ReplicationMode.OVERWRITE - écrase n'importe quelle ligne "
"existante dans la base de données avec le même identifiant "

#. Tag: para
#: session_api.xml:680
#, no-c-format
msgid ""
"<literal>ReplicationMode.EXCEPTION: throws an exception if there "
"is an existing database row with the same identifier"
msgstr ""
"<literal>ReplicationMode.EXCEPTION - lève une exception s'il y a "
"une ligne dans la base de données avec le même identifiant "

#. Tag: para
#: session_api.xml:686
#, no-c-format
msgid ""
"<literal>ReplicationMode.LATEST_VERSION: overwrites the row if its "
"version number is earlier than the version number of the object, or ignore "
"the object otherwise"
msgstr ""
"<literal>ReplicationMode.LATEST_VERSION - écrase la ligne si son "
"numéro de version est plus petit que le numéro de version de l'objet, sinon "
"ignore l'objet  "

#. Tag: para
#: session_api.xml:692
#, no-c-format
msgid ""
"Usecases for this feature include reconciling data entered into different "
"database instances, upgrading system configuration information during "
"product upgrades, rolling back changes made during non-ACID transactions and "
"more."
msgstr ""
"Les cas d'utilisation de cette fonctionnalité incluent la réconciliation de "
"données entrées dans différentes base de données, l'extension des "
"informations de configuration du système durant une mise à jour du produit, "
"retour en arrière sur les changements effectués durant des transactions non-"
"ACID, et plus."

#. Tag: title
#: session_api.xml:699
#, no-c-format
msgid "Flushing the Session"
msgstr "Flush de la session"

#. Tag: para
#: session_api.xml:701
#, no-c-format
msgid ""
"Sometimes the <literal>Session will execute the SQL statements "
"needed to synchronize the JDBC connection's state with the state of objects "
"held in memory. This process, called <emphasis>flush, occurs by "
"default at the following points:"
msgstr ""
"De temps en temps la <literal>Session exécutera les expressions "
"SQL requises pour synchroniser l'état de la connexion JDBC avec l'état des "
"objets retenus en mémoire. Ce processus, <emphasis>flush, "
"survient par défaut aux points suivants : "

#. Tag: para
#: session_api.xml:709
#, no-c-format
msgid "before some query executions"
msgstr "avant certaines exécutions de requête"

#. Tag: para
#: session_api.xml:713
#, no-c-format
msgid "from <literal>org.hibernate.Transaction.commit()"
msgstr ""
"lors d'un appel à <literal>org.hibernate.Transaction.commit()"

#. Tag: para
#: session_api.xml:718
#, no-c-format
msgid "from <literal>Session.flush()"
msgstr "lors d'un appel à <literal>Session.flush()"

#. Tag: para
#: session_api.xml:722
#, no-c-format
msgid "The SQL statements are issued in the following order:"
msgstr "Les expressions SQL sont effectuées dans l'ordre suivant : "

#. Tag: para
#: session_api.xml:726
#, no-c-format
msgid ""
"all entity insertions in the same order the corresponding objects were saved "
"using <literal>Session.save()"
msgstr ""
"insertion des entités, dans le même ordre que celui des objets "
"correspondants sauvegardés par l'appel à <literal>Session.save() "

#. Tag: para
#: session_api.xml:731
#, no-c-format
msgid "all entity updates"
msgstr "mise à jour des entités"

#. Tag: para
#: session_api.xml:735
#, no-c-format
msgid "all collection deletions"
msgstr "suppression des collections"

#. Tag: para
#: session_api.xml:739
#, no-c-format
msgid "all collection element deletions, updates and insertions"
msgstr "suppression, mise à jour et insertion des éléments des collections"

#. Tag: para
#: session_api.xml:743
#, no-c-format
msgid "all collection insertions"
msgstr "insertion des collections"

#. Tag: para
#: session_api.xml:747
#, no-c-format
msgid ""
"all entity deletions in the same order the corresponding objects were "
"deleted using <literal>Session.delete()"
msgstr ""
"suppression des entités, dans le même ordre que celui des objets "
"correspondants qui ont été supprimés par l'appel de <literal>Session.delete()"
"</literal> "

#. Tag: para
#: session_api.xml:752
#, no-c-format
msgid ""
"An exception is that objects using <literal>native ID generation "
"are inserted when they are saved."
msgstr ""
"Une exception est que des objets utilisant la génération <literal>native, there are absolutely "
"no guarantees about <emphasis>when the Session "
"executes the JDBC calls, only the <emphasis>order in which they "
"are executed. However, Hibernate does guarantee that the <literal>Query.list"
"(..)</literal> will never return stale or incorrect data."
msgstr ""
"Excepté lorsque vous appelez <literal>flush() explicitement, il "
"n'y a absolument aucune garantie à propos de <emphasis>quand la "
"<literal>Session exécute les appels JDBC, seulement sur "
"l'<emphasis>ordre dans lequel ils sont exécutés. Cependant, "
"Hibernate garantit que <literal>Query.list(..) ne retournera "
"jamais de données périmées, ni des données fausses. "

#. Tag: para
#: session_api.xml:762
#, fuzzy, no-c-format
msgid ""
"It is possible to change the default behavior so that flush occurs less "
"frequently. The <literal>FlushMode class defines three different "
"modes: only flush at commit time when the Hibernate <literal>Transaction is called explicitly. The last "
"mode is useful for long running units of work, where a <literal>Session définit "
"trois modes différents : flush seulement lors du commit (et seulement quand "
"l'API <literal>Transaction de Hibernate est utilisé), flush "
"automatiquement en utilisant la procédure courante expliquée, ou jamais de "
"flush à moins que <literal>flush() soit appelé explicitement. Le "
"dernier mode est utile pour l'exécution de longues unités de travail, où une "
"<literal>Session est gardée ouverte et déconnectée pour un long "
"moment (voir <xref linkend=\"transactions-optimistic-longsession\" />)."

#. Tag: programlisting
#: session_api.xml:772
#, no-c-format
msgid ""
"sess = sf.openSession();\n"
"Transaction tx = sess.beginTransaction();\n"
"sess.setFlushMode(FlushMode.COMMIT); // allow queries to return stale state\n"
"\n"
"Cat izi = (Cat) sess.load(Cat.class, id);\n"
"izi.setName(iznizi);\n"
"\n"
"// might return stale data\n"
"sess.find(\"from Cat as cat left outer join cat.kittens kitten\");\n"
"\n"
"// change to izi is not flushed!\n"
"...\n"
"tx.commit(); // flush occurs\n"
"sess.close();"
msgstr ""

#. Tag: para
#: session_api.xml:774
#, fuzzy, no-c-format
msgid ""
"During flush, an exception might occur (e.g. if a DML operation violates a "
"constraint). Since handling exceptions involves some understanding of "
"Hibernate's transactional behavior, we discuss it in <xref linkend="
"\"transactions\"/>."
msgstr ""
"Durant le flush, une exception peut se produire (par exemple, si une "
"opération de la DML viole une contrainte). Les exceptions de gestion "
"impliquent une certaine compréhension du comportement transactionnel de "
"Hibernate, le sujet sera donc abordé dans <xref linkend=\"transactions\" />."

#. Tag: title
#: session_api.xml:781
#, no-c-format
msgid "Transitive persistence"
msgstr "Persistance transitive"

#. Tag: para
#: session_api.xml:783
#, no-c-format
msgid ""
"It is quite cumbersome to save, delete, or reattach individual objects, "
"especially if you deal with a graph of associated objects. A common case is "
"a parent/child relationship. Consider the following example:"
msgstr ""
"Il est assez pénible de sauvegarder, supprimer, ou rattacher des objets un "
"par un, surtout si vous traitez un graphe d'objets associés. Un cas courant "
"est une relation parent/enfant. Considérez l'exemple suivant :"

#. Tag: para
#: session_api.xml:788
#, no-c-format
msgid ""
"If the children in a parent/child relationship would be value typed (e.g. a "
"collection of addresses or strings), their life cycle would depend on the "
"parent and no further action would be required for convenient \"cascading\" "
"of state changes. When the parent is saved, the value-typed child objects "
"are saved and when the parent is deleted, the children will be deleted, etc. "
"This works for operations such as the removal of a child from the "
"collection. Since value-typed objects cannot have shared references, "
"Hibernate will detect this and delete the child from the database."
msgstr ""
"Si les enfants de la relation parent/enfant étaient des types de valeur (par "
"exemple, une collection d'adresses ou de chaînes de caractères), leur cycle "
"de vie dépendrait du parent et aucune action ne serait requise pour "
"\"cascader\" facilement les changements d'état. Si le parent est sauvegardé, "
"les objets enfants de type de valeur sont sauvegardés également, si le "
"parent est supprimé, les enfants sont supprimés, etc. Ceci fonctionne même "
"pour des opérations telles que la suppression d'un enfant de la collection ; "
"Hibernate le détectera et étant donné que les objets de type de valeur ne "
"peuvent pas avoir de références partagées, il supprimera l'enfant de la base "
"de données. "

#. Tag: para
#: session_api.xml:798
#, no-c-format
msgid ""
"Now consider the same scenario with parent and child objects being entities, "
"not value-types (e.g. categories and items, or parent and child cats). "
"Entities have their own life cycle and support shared references. Removing "
"an entity from the collection does not mean it can be deleted), and there is "
"by default no cascading of state from one entity to any other associated "
"entities. Hibernate does not implement <emphasis>persistence by "
"reachability</emphasis> by default."
msgstr ""
"Maintenant considérez le même scénario avec un parent dont les objets "
"enfants sont des entités, et non des types de valeur (par exemple, des "
"catégories et des objets, ou un parent et des chatons). Les entités ont leur "
"propre cycle de vie, supportent les références partagées (donc supprimer une "
"entité de la collection ne signifie pas qu'elle peut être supprimée), et il "
"n'y a par défaut pas de cascade d'état d'une entité vers n'importe quelle "
"entité associée. Hibernate n'implémente pas la <emphasis>persistance par "
"accessibilité</emphasis> par défaut. "

#. Tag: para
#: session_api.xml:806
#, no-c-format
msgid ""
"For each basic operation of the Hibernate session - including "
"<literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), "
"evict(), replicate()</literal> - there is a corresponding cascade style. "
"Respectively, the cascade styles are named <literal>create, merge, save-"
"update, delete, lock, refresh, evict, replicate</literal>. If you want an "
"operation to be cascaded along an association, you must indicate that in the "
"mapping document. For example:"
msgstr ""
"Pour chaque opération basique de la session Hibernate - incluant "
"<literal>persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), "
"evict(), replicate()</literal> - il y a un style de cascade correspondant. "
"Respectivement, les styles de cascade s'appellent <literal>persist, merge, "
"save-update, delete, lock, refresh, evict, replicate</literal>. Si vous "
"voulez qu'une opération soit cascadée le long d'une association, vous devez "
"l'indiquer dans le document de mappage. Par exemple :"

#. Tag: programlisting
#: session_api.xml:814
#, no-c-format
msgid "<one-to-one name=\"person\" cascade=\"persist\"/>"
msgstr ""

#. Tag: para
#: session_api.xml:816
#, no-c-format
msgid "Cascade styles my be combined:"
msgstr "Les styles de cascade peuvent être combinés :"

#. Tag: programlisting
#: session_api.xml:818
#, no-c-format
msgid "<one-to-one name=\"person\" cascade=\"persist,delete,lock\"/>"
msgstr ""

#. Tag: para
#: session_api.xml:820
#, no-c-format
msgid ""
"You can even use <literal>cascade=\"all\" to specify that "
"<emphasis>all operations should be cascaded along the "
"association. The default <literal>cascade=\"none\" specifies that "
"no operations are to be cascaded."
msgstr ""
"Vous pouvez même utiliser <literal>cascade=\"all\" pour spécifier "
"que <emphasis>toutes les opérations devraient être cascadées le "
"long de l'association. La valeur par défaut <literal>cascade=\"none\" attribute taking an array of "
"<classname>CascadeType as a value. The cascade concept in JPA is "
"very is similar to the transitive persistence and cascading of operations as "
"described above, but with slightly different semantics and cascading types:"
msgstr ""

#. Tag: para
#: session_api.xml:834
#, no-c-format
msgid ""
"<literal>CascadeType.PERSIST: cascades the persist (create) "
"operation to associated entities persist() is called or if the entity is "
"managed"
msgstr ""

#. Tag: para
#: session_api.xml:840
#, no-c-format
msgid ""
"<literal>CascadeType.MERGE: cascades the merge operation to "
"associated entities if merge() is called or if the entity is managed"
msgstr ""

#. Tag: para
#: session_api.xml:846
#, no-c-format
msgid ""
"<literal>CascadeType.REMOVE: cascades the remove operation to "
"associated entities if delete() is called"
msgstr ""

#. Tag: para
#: session_api.xml:851
#, no-c-format
msgid ""
"<literal>CascadeType.REFRESH: cascades the refresh operation to "
"associated entities if refresh() is called"
msgstr ""

#. Tag: para
#: session_api.xml:856
#, no-c-format
msgid ""
"<literal>CascadeType.DETACH: cascades the detach operation to "
"associated entities if detach() is called"
msgstr ""

#. Tag: para
#: session_api.xml:861
#, fuzzy, no-c-format
msgid "<literal>CascadeType.ALL: all of the above"
msgstr "<literal>saveOrUpdate() s'utilise dans le cas suivant :"

#. Tag: para
#: session_api.xml:866
#, no-c-format
msgid ""
"CascadeType.ALL also covers Hibernate specific operations like save-update, "
"lock etc..."
msgstr ""

#. Tag: para
#: session_api.xml:870
#, no-c-format
msgid ""
"A special cascade style, <literal>delete-orphan, applies only to "
"one-to-many associations, and indicates that the <literal>delete() "
"operation should be applied to any child object that is removed from the "
"association. Using annotations there is no <literal>CascadeType.DELETE-"
"ORPHAN</literal> equivalent. Instead you can use the attribute "
"<literal>orphanRemoval as seen in  collection or an associated entity is "
"dereferenced from a <classname>@OneToOne association, this "
"associated entity can be marked for deletion if <literal>orphanRemoval with orphanRemoval"
msgstr ""

#. Tag: programlisting
#: session_api.xml:886
#, no-c-format
msgid ""
"@Entity \n"
"public class Customer {\n"
"   private Set<Order> orders;\n"
"\n"
"   @OneToMany(cascade=CascadeType.ALL, orphanRemoval=true) \n"
"   public Set<Order> getOrders() { return orders; }\n"
"\n"
"   public void setOrders(Set<Order> orders) { this.orders = orders; }\n"
"\n"
"   [...]\n"
"}\n"
"\n"
"@Entity \n"
"public class Order { ... }\n"
"\n"
"Customer customer = em.find(Customer.class, 1l);\n"
"Order order = em.find(Order.class, 1l);\n"
"customer.getOrders().remove(order); //order will be deleted by cascade"
msgstr ""

#. Tag: para
#: session_api.xml:889
#, no-c-format
msgid "Recommendations:"
msgstr "Recommandations :"

#. Tag: para
#: session_api.xml:893
#, fuzzy, no-c-format
msgid ""
"It does not usually make sense to enable cascade on a many-to-one or many-to-"
"many association. In fact the <literal>@ManyToOne and "
"<literal>@ManyToMany don't even offer a orphanRemoval ou <many-to-many> et <one-to-many> by specifying "
"<literal>cascade=\"all,delete-orphan\"(@OneToMany"
"(cascade=CascadeType.ALL, orphanRemoval=true)</literal>)."
msgstr ""
"Si la durée de vie de l'objet enfant est liée à la durée de vie de l'objet "
"parent, faites-en un <emphasis>objet du cycle de vie en "
"spécifiant <literal>cascade=\"all,delete-orphan\". "

#. Tag: para
#: session_api.xml:909
#, no-c-format
msgid ""
"Otherwise, you might not need cascade at all. But if you think that you will "
"often be working with the parent and children together in the same "
"transaction, and you want to save yourself some typing, consider using "
"<literal>cascade=\"persist,merge,save-update\"."
msgstr ""
"Sinon, vous pourriez ne pas avoir besoin de cascade du tout. Mais si vous "
"pensez que vous travaillerez souvent avec le parent et les enfants ensemble "
"dans la même transaction, et que vous voulez vous éviter quelques frappes, "
"considérez l'utilisation de <literal>cascade=\"persist,merge,save-update\" marks the association as a "
"<emphasis>parent/child style relationship where save/update/"
"delete of the parent results in save/update/delete of the child or children."
msgstr ""
"Mapper une association (soit une simple association valuée, soit une "
"collection) avec <literal>cascade=\"all\" marque l'association "
"comme une relation de style <emphasis>parent/enfant où la "
"sauvegarde/mise à jour/suppression du parent entraîne la sauvegarde/mise à "
"jour/suppression de l'enfant ou des enfants."

#. Tag: para
#: session_api.xml:923
#, fuzzy, no-c-format
msgid ""
"Furthermore, a mere reference to a child from a persistent parent will "
"result in save/update of the child. This metaphor is incomplete, however. A "
"child which becomes unreferenced by its parent is <emphasis>not "
"automatically deleted, except in the case of a one-to-many association "
"mapped with <literal>cascade=\"delete-orphan\". The precise "
"semantics of cascading operations for a parent/child relationship are as "
"follows:"
msgstr ""
"Par ailleurs, une simple référence à un enfant d'un parent persistant aura "
"pour conséquence la sauvegarde/mise à jour de l'enfant. Cette métaphore est "
"cependant incomplète. Un enfant qui devient non référencé par son parent "
"<emphasis>n'est pas automatiquement supprimé, sauf dans le cas "
"d'une association <literal><one-to-many> mappée avec "
"<literal>cascade=\"delete-orphan\". La sémantique précise des "
"opérations de cascade pour une relation parent/enfant est la suivante : "

#. Tag: para
#: session_api.xml:934
#, no-c-format
msgid ""
"If a parent is passed to <literal>persist(), all children are "
"passed to <literal>persist()"
msgstr ""
"Si un parent est passé à <literal>persist(), tous les enfant sont "
"passés à <literal>persist()"

#. Tag: para
#: session_api.xml:939
#, no-c-format
msgid ""
"If a parent is passed to <literal>merge(), all children are passed "
"to <literal>merge()"
msgstr ""
"Si un parent est passé à <literal>merge(), tous les enfants sont "
"passés à <literal>merge()"

#. Tag: para
#: session_api.xml:944
#, no-c-format
msgid ""
"If a parent is passed to <literal>save(), update()saveOrUpdate(), all children are passed to "
"<literal>saveOrUpdate()"
msgstr ""
"Si un parent est passé à <literal>save(), update()saveOrUpdate(), tous les enfants sont passés "
"à <literal>saveOrUpdate()"

#. Tag: para
#: session_api.xml:950
#, no-c-format
msgid ""
"If a transient or detached child becomes referenced by a persistent parent, "
"it is passed to <literal>saveOrUpdate()"
msgstr ""
"Si un enfant détaché ou éphémère devient référencé par un parent persistant, "
"il est passé à <literal>saveOrUpdate()"

#. Tag: para
#: session_api.xml:956
#, no-c-format
msgid ""
"If a parent is deleted, all children are passed to <literal>delete(), in which "
"case the \"orphaned\" child is deleted."
msgstr ""
"Si un enfant est déréférencé par un parent persistant, <emphasis>rien de "
"spécial n'arrive</emphasis> - l'application devrait explicitement supprimer "
"l'enfant si nécessaire - à moins que <literal>cascade=\"delete-orphan\" or at flush time. All "
"operations, if enabled, are cascaded to associated entities reachable when "
"the operation is executed. However, <literal>save-update and "
"<literal>delete-orphan are transitive for all associated entities "
"reachable during flush of the <literal>Session."
msgstr ""
"Enfin, la cascade des opérations peut être effectuée sur un graphe donné "
"lors de l'<emphasis>appel de l'opération or lors du "
"<emphasis>flush suivant. Toutes les opérations, lorsqu'elles sont "
"cascadées, le sont sur toutes les entités associées accessibles lorsque "
"l'opération est exécutée. Cependant <literal>save-upate et "
"<literal>delete-orphan sont cascadés à toutes les entités "
"associées accessibles lors du flush de la <literal>Session. "

#. Tag: title
#: session_api.xml:979
#, no-c-format
msgid "Using metadata"
msgstr "Utilisation des méta-données"

#. Tag: para
#: session_api.xml:981
#, no-c-format
msgid ""
"Hibernate requires a rich meta-level model of all entity and value types. "
"This model can be useful to the application itself. For example, the "
"application might use Hibernate's metadata to implement a \"smart\" deep-"
"copy algorithm that understands which objects should be copied (eg. mutable "
"value types) and which objects that should not (e.g. immutable value types "
"and, possibly, associated entities)."
msgstr ""
"Hibernate requiert un modèle de méta-niveau très riche de toutes les entités "
"et types valués. De temps en temps, ce modèle est très utile à l'application "
"elle même. Par exemple, l'application pourrait utiliser les méta-données de "
"Hibernate pour implémenter un algorithme de copie en profondeur \"intelligent"
"\" qui comprendrait quels objets devraient être copiés (par exemple les "
"types de valeur mutables) et lesquels ne devraient pas l'être (par exemple "
"les types de valeurs immutables et, éventuellement, les entités associées). "

#. Tag: para
#: session_api.xml:988
#, no-c-format
msgid ""
"Hibernate exposes metadata via the <literal>ClassMetadata and "
"<literal>CollectionMetadata interfaces and the Type."
msgstr ""
"Hibernate expose les méta-données via les interfaces <literal>ClassMetadataCollectionMetadata et la hiérarchie "
"<literal>Type. Les instances des interfaces de méta-données "
"peuvent être obtenues à partir de la <literal>SessionFactory. "

#. Tag: programlisting
#: session_api.xml:993
#, no-c-format
msgid ""
"Cat fritz = ......;\n"
"ClassMetadata catMeta = sessionfactory.getClassMetadata(Cat.class);\n"
"\n"
"Object[] propertyValues = catMeta.getPropertyValues(fritz);\n"
"String[] propertyNames = catMeta.getPropertyNames();\n"
"Type[] propertyTypes = catMeta.getPropertyTypes();\n"
"\n"
"// get a Map of all properties which are not collections or associations\n"
"Map namedValues = new HashMap();\n"
"for ( int i=0; i<propertyNames.length; i++ ) {\n"
"    if ( !propertyTypes[i].isEntityType() && !propertyTypes[i]."
"isCollectionType() ) {\n"
"        namedValues.put( propertyNames[i], propertyValues[i] );\n"
"    }\n"
"}"
msgstr ""

#, fuzzy
#~ msgid ""
#~ "Hibernate does not offer its own API for direct execution of "
#~ "<literal>UPDATE or DELETE statements. "
#~ "Hibernate is a <emphasis>state management service, you do not "
#~ "have to think in <emphasis>statements to use it. JDBC is a "
#~ "perfect API for executing SQL statements, you can get a JDBC "
#~ "<literal>Connection at any time by calling session."
#~ "connection()</literal>. Furthermore, the notion of mass operations "
#~ "conflicts with object/relational mapping for online transaction "
#~ "processing-oriented applications. Future versions of Hibernate can, "
#~ "however, provide special mass operation functions. See <xref linkend="
#~ "\"batch\"/> for some possible batch operation tricks."
#~ msgstr ""
#~ "Notez que Hibernate n'offre par sa propre API pour l'exécution directe "
#~ "d'expressions <literal>UPDATE ou DELETE. "
#~ "Hibernate est un service de <emphasis>gestion d'état, vous "
#~ "n'avez pas à penser aux <emphasis>expressions pour l'utiliser. "
#~ "JDBC est une API parfaite pour exécuter des expressions SQL, vous pouvez "
#~ "obtenir une <literal>Connection JDBC à tout moment en appelant "
#~ "<literal>session.connection(). En outre, la notion d'opérations "
#~ "de masse entre en conflit avec le mapping objet/relationnel pour les "
#~ "applications orientées processus de transactions en ligne. Les futures "
#~ "versions de Hibernate pourront cependant fournir des fonctions "
#~ "particulières d'opération de masse. Voir <xref linkend=\"batch\" /> pour "
#~ "des astuces possibles d'opérations groupées. "

#~ msgid ""
#~ "A special cascade style, <literal>delete-orphan, applies only "
#~ "to one-to-many associations, and indicates that the <literal>delete(), s'applique "
#~ "seulement aux associations un-à-plusieurs, et indique que l'opération "
#~ "<literal>delete() devrait être appliquée à tout enfant supprimé "
#~ "de l'association."

Other Hibernate examples (source code examples)

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