📄 session_api.po
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2008-08-14 15:28+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: session_api.xml:29#, no-c-formatmsgid "Working with objects"msgstr "Travailler avec des objets"#. Tag: para#: session_api.xml:31#, no-c-formatmsgid """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</emphasis> of objects. This is, ""contrary to the management of SQL <literal>statements</literal> in common ""JDBC/SQL persistence layers, a very natural object-oriented view of ""persistence in Java applications."msgstr """Hibernate est une solution de mapping objet/relationnel complète qui ne ""masque pas seulement au développpeur les détails du système de gestion de ""base de données sous-jacent, mais offre aussi <emphasis>la gestion d'état</""emphasis> des objets. C'est, contrairement à la gestion de ""<literal>statements</literal> 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-formatmsgid """In other words, Hibernate application developers should always think about ""the <emphasis>state</emphasis> 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 mots, les développeurs d'applications Hibernate devrait toujours ""réfléchir à <emphasis>l'état</emphasis> de leurs objets, et pas ""nécessairement à l'exécution des expressions SQL. Cette part est prise en ""charge pas Hibernate et seulement importante pour les développeurs ""d'applications lors du réglage de la performance de leur système."#. Tag: title#: session_api.xml:48#, no-c-formatmsgid "Hibernate object states"msgstr "États des objets Hibernate"#. Tag: para#: session_api.xml:50#, no-c-formatmsgid "Hibernate defines and supports the following object states:"msgstr "Hibernate définit et comprend les états suivants :"#. Tag: para#: session_api.xml:56#, no-c-formatmsgid """<emphasis>Transient</emphasis> - an object is transient if it has just been ""instantiated using the <literal>new</literal> operator, and it is not ""associated with a Hibernate <literal>Session</literal>. 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 doesn't hold a reference anymore. Use the Hibernate ""<literal>Session</literal> 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</emphasis> (NdT : transient) - un objet est éphémère s'il ""a juste été instancié en utilisant l'opérateur <literal>new</literal>. 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</literal> 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:68#, no-c-formatmsgid """<emphasis>Persistent</emphasis> - 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</""literal>. Hibernate will detect any changes made to an object in persistent ""state and synchronize the state with the database when the unit of work ""completes. Developers don't execute manual <literal>UPDATE</literal> ""statements, or <literal>DELETE</literal> statements when an object should be ""made transient."msgstr """<emphasis>Persistant</emphasis> - 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</literal>. Hibernate ""détectera n'importe quels changements effectués sur un objet dans l'état ""persistant et synchronisera l'état avec la base de données lors de la fin ""l'unité de travail. Les développeurs n'exécutent pas d'expressions ""<literal>UPDATE</literal> ou <literal>DELETE</literal> manuelles lorsqu'un ""objet devrait être rendu éphémère."#. Tag: para#: session_api.xml:79#, no-c-formatmsgid """<emphasis>Detached</emphasis> - a detached instance is an object that has ""been persistent, but its <literal>Session</literal> 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</literal> 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</emphasis>, i.e. a unit of work from ""the point of view of the user."msgstr """<emphasis>Détaché</emphasis> - une instance détachée est un objet qui a été ""persistant, mais dont sa <literal>Session</literal> 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 ""réattachée à une nouvelle <literal>Session</literal> plus tard dans le ""temps, 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</emphasis>, ""c'est-à-dire une unité de travail du point de vue de l'utilisateur."#. Tag: para#: session_api.xml:93#, no-c-formatmsgid """We'll now discuss the states and state transitions (and the Hibernate ""methods that trigger a transition) in more detail."msgstr """Nous alons maintenant dicuster des états et des transitions d'état (et des ""méthodes d'Hibernate qui déclenchent une transition) plus en détails."#. Tag: title#: session_api.xml:101#, no-c-formatmsgid "Making objects persistent"msgstr "Rendre des objets persistants"#. Tag: para#: session_api.xml:103#, no-c-formatmsgid """Newly instantiated instances of a a persistent class are considered ""<emphasis>transient</emphasis> by Hibernate. We can make a transient ""instance <emphasis>persistent</emphasis> by associating it with a session:"msgstr """Les instances nouvellement instanciées d'une classe persistante sont ""considérées <emphasis>éphémères</emphasis> par Hibernate. Nous pouvons ""rendre une instance éphémère <emphasis>persistante</emphasis> en l'associant ""avec une session :"#. Tag: programlisting#: session_api.xml:110#, no-c-formatmsgid """<![CDATA[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:112#, no-c-formatmsgid """If <literal>Cat</literal> has a generated identifier, the identifier is ""generated and assigned to the <literal>cat</literal> when <literal>save()</""literal> is called. If <literal>Cat</literal> has an <literal>assigned</""literal> identifier, or a composite key, the identifier should be assigned ""to the <literal>cat</literal> instance before calling <literal>save()</""literal>. You may also use <literal>persist()</literal> instead of ""<literal>save()</literal>, with the semantics defined in the EJB3 early ""draft."msgstr """Si <literal>Cat</literal> a un identifiant généré, l'identifiant est généré ""et assigné au <literal>cat</literal> lorsque <literal>save()</literal> est ""appelée. Si <literal>Cat</literal> a un identifiant <literal>assigned</""literal>, ou une clef composée, l'identifiant devrait être assigné à ""l'instance de <literal>cat</literal> avant d'appeler <literal>save()</""literal>. Vous pouvez aussi utiliser <literal>persist()</literal> à la place ""de<literal>save()</literal>, avec la sémantique définie plus tôt dans le ""brouillon d'EJB3."#. Tag: para#: session_api.xml:124#, no-c-formatmsgid """<literal>persist()</literal> makes a transient instance persistent. However, ""it doesn't guarantee that the identifier value will be assigned to the ""persistent instance immediately, the assignment might happen at flush time. ""<literal>persist()</literal> also guarantees that it will not execute an ""<literal>INSERT</literal> 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()</literal> makes a transient instance persistent. However, ""it doesn't guarantee that the identifier value will be assigned to the ""persistent instance immediately, the assignment might happen at flush time. ""<literal>persist()</literal> also guarantees that it will not execute an ""<literal>INSERT</literal> statement if it is called outside of transaction ""boundaries. This is useful in long-running conversations with an extended ""Session/persistence context."#. Tag: para#: session_api.xml:135#, no-c-formatmsgid """<literal>save()</literal> 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()</literal> 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."#. Tag: para#: session_api.xml:145#, no-c-formatmsgid """Alternatively, you may assign the identifier using an overloaded version of ""<literal>save()</literal>."msgstr """Alternativement, vous pouvez assigner l'identifiant en utilisant une version ""surchargée de <literal>save()</literal>."#. Tag: programlisting#: session_api.xml:150#, no-c-formatmsgid """<![CDATA[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:152#, no-c-formatmsgid """If the object you make persistent has associated objects (e.g. the ""<literal>kittens</literal> collection in the previous example), these ""objects may be made persistent in any order you like unless you have a ""<literal>NOT NULL</literal> constraint upon a foreign key column. There is ""never a risk of violating foreign key constraints. However, you might ""violate a <literal>NOT NULL</literal> constraint if you <literal>save()</""literal> the objects in the wrong order."msgstr """Si l'objet que vous rendez persistant a des objets associés (par exemple, la ""collection <literal>kittens</literal> dans l'exemple précédent), ces objets ""peuvent être rendus persistants dans n'importe quel ordre que vous souhaitez ""à moins que vous ayez une contrainte <literal>NOT NULL</literal> sur la ""colonne de la clef étrangère. Il n'y a jamais de risque de violer une ""contrainte de clef étrangère. Cependant, vous pourriez violer une contrainte ""<literal>NOT NULL</literal> si vous appeliez <literal>save()</literal> sur ""les objets dans le mauvais ordre."#. Tag: para#: session_api.xml:162#, no-c-formatmsgid """Usually you don't bother with this detail, as you'll very likely use ""Hibernate's <emphasis>transitive persistence</emphasis> feature to save the ""associated objects automatically. Then, even <literal>NOT NULL</literal> ""constraint violations don't 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> d'Hibernate pour sauvegarder les objets associés ""automatiquement. Alors, même les violations de contrainte <literal>NOT NULL</""literal> n'ont plus lieu - Hibernate prendra soin de tout. La persistance ""transitive est traitée plus loin dans ce chapitre."#. Tag: title#: session_api.xml:173#, no-c-formatmsgid "Loading an object"msgstr "Chargement d'un objet"#. Tag: para#: session_api.xml:175#, no-c-formatmsgid """The <literal>load()</literal> methods of <literal>Session</literal> gives ""you a way to retrieve a persistent instance if you already know its ""identifier. <literal>load()</literal> takes a class object and will load the ""state into a newly instantiated instance of that class, in persistent state."msgstr """Les méthodes <literal>load()</literal> de <literal>Session</literal> vous ""donnent un moyen de récupérer une instance persistante si vous connaissez ""déjà son identifiant. <literal>load()</literal> 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:182#, no-c-formatmsgid "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"msgstr ""#. Tag: programlisting#: session_api.xml:184#, no-c-formatmsgid """<![CDATA[// 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:186#, no-c-formatmsgid "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:190#, no-c-formatmsgid ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -