⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tutorial.po

📁 hibernate-distribution-3.3.1.GA-dist.zip源码
💻 PO
📖 第 1 页 / 共 5 页
字号:
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#: tutorial.xml:33#, no-c-formatmsgid "Introduction to Hibernate"msgstr "Introduction à Hibernate"#. Tag: title#: tutorial.xml:36#, no-c-formatmsgid "Preface"msgstr "Préface"#. Tag: para#: tutorial.xml:38#, no-c-formatmsgid """This chapter is an introduction to Hibernate by way of a tutorial, intended ""for new users of Hibernate. We start with a simple application using an in-""memory database. We build the application in small, easy to understand ""steps. The tutorial is based on another, earlier one developed by Michael ""Gloegl. All code is contained in the <filename>tutorials/web</filename> ""directory of the project source."msgstr ""#. Tag: para#: tutorial.xml:51#, no-c-formatmsgid """This tutorial expects the user have knowledge of both Java and SQL. If you ""are new or uncomfortable with either, it is advised that you start with a ""good introduction to that technology prior to attempting to learn Hibernate. ""It will save time and effort in the long run."msgstr ""#. Tag: para#: tutorial.xml:61#, no-c-formatmsgid """There is another tutorial/example application in the <filename>/tutorials/""eg</filename> directory of the project source. That example is console based ""and as such would not have the dependency on a servlet container to execute. ""The basic setup is the same as the instructions below."msgstr ""#. Tag: title#: tutorial.xml:71#, no-c-formatmsgid "Part 1 - The first Hibernate Application"msgstr "Partie 1 - Première application Hibernate"#. Tag: para#: tutorial.xml:73#, no-c-formatmsgid """Let's assume we need a small database application that can store events we ""want to attend, and information about the host(s) of these events. We will ""use an in-memory, Java database named HSQLDB to avoid describing ""installation/setup of any particular database servers. Feel free to tweak ""this tutorial to use whatever database you feel comfortable using."msgstr ""#. Tag: para#: tutorial.xml:82#, no-c-formatmsgid """The first thing we need to do is set up our development environment, and ""specifically to setup all the required dependencies to Hibernate as well as ""other libraries. Hibernate is built using Maven which amongst other features ""provides <literal>dependecy management</literal>; moreover it provides ""<emphasis>transitive</emphasis> <literal>dependecy management</literal> ""which simply means that to use Hibernate we can simply define our dependency ""on Hibernate, Hibernate itself defines the dependencies it needs which then ""become transitive dependencies of our project."msgstr ""#. Tag: programlisting#: tutorial.xml:94#, no-c-formatmsgid """<![CDATA[.\n""<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n""         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n""         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.""apache.org/xsd/maven-4.0.0.xsd\">\n""\n""    ...\n""\n""    <dependencies>\n""        <dependency>\n""            <groupId>${groupId}</groupId>\n""            <artifactId>hibernate-core</artifactId>\n""        </dependency>\n""\n""        <!-- Because this is a web app, we also have a dependency on the ""servlet api. -->\n""        <dependency>\n""            <groupId>javax.servlet</groupId>\n""            <artifactId>servlet-api</artifactId>\n""        </dependency>\n""    </dependencies>\n""\n""</project>]]>"msgstr ""#. Tag: para#: tutorial.xml:97#, no-c-formatmsgid """Essentially we are describing here the <filename>/tutorials/web/pom.xml</""filename> file. See the <ulink url=\"http://maven.org\">Maven</ulink> site ""for more information."msgstr ""#. Tag: para#: tutorial.xml:105#, no-c-formatmsgid """While not strictly necessary, most IDEs have integration with Maven to read ""these POM files and automatically set up a project for you which can save ""lots of time and effort."msgstr ""#. Tag: para#: tutorial.xml:112#, no-c-formatmsgid """Next we create a class that represents the event we want to store in ""database."msgstr """Ensuite, nous créons une classe qui réprésente l'événement que nous voulons ""stocker dans notre base de données."#. Tag: title#: tutorial.xml:117#, no-c-formatmsgid "The first class"msgstr "La première classe"#. Tag: para#: tutorial.xml:119#, no-c-formatmsgid """Our first persistent class is a simple JavaBean class with some properties:"msgstr """Notre première classe persistante est une simple classe JavaBean avec ""quelques propriétés :"#. Tag: programlisting#: tutorial.xml:123#, no-c-formatmsgid """<![CDATA[package org.hibernate.tutorial.domain;\n""\n""import java.util.Date;\n""\n""public class Event {\n""    private Long id;\n""\n""    private String title;\n""    private Date date;\n""\n""    public Event() {}\n""\n""    public Long getId() {\n""        return id;\n""    }\n""\n""    private void setId(Long id) {\n""        this.id = id;\n""    }\n""\n""    public Date getDate() {\n""        return date;\n""    }\n""\n""    public void setDate(Date date) {\n""        this.date = date;\n""    }\n""\n""    public String getTitle() {\n""        return title;\n""    }\n""\n""    public void setTitle(String title) {\n""        this.title = title;\n""    }\n""}]]>"msgstr ""#. Tag: para#: tutorial.xml:125#, no-c-formatmsgid """You can see that this class uses standard JavaBean naming conventions for ""property getter and setter methods, as well as private visibility for the ""fields. This is a recommended design - but not required. Hibernate can also ""access fields directly, the benefit of accessor methods is robustness for ""refactoring. The no-argument constructor is required to instantiate an ""object of this class through reflection."msgstr """Vous pouvez voir que cette classe utilise les conventions de nommage ""standard JavaBean pour les méthodes getter/setter des propriétés, ainsi ""qu'une visibilité privée pour les champs. Ceci est la conception recommandée ""- mais pas obligatoire. Hibernate peut aussi accéder aux champs directement, ""le bénéfice des méthodes d'accès est la robustesse pour la refonte de code. ""Le constructeur sans argument est requis pour instancier un objet de cette ""classe via reflexion."#. Tag: para#: tutorial.xml:133#, no-c-formatmsgid """The <literal>id</literal> property holds a unique identifier value for a ""particular event. All persistent entity classes (there are less important ""dependent classes as well) will need such an identifier property if we want ""to use the full feature set of Hibernate. In fact, most applications (esp. ""web applications) need to distinguish objects by identifier, so you should ""consider this a feature rather than a limitation. However, we usually don't ""manipulate the identity of an object, hence the setter method should be ""private. Only Hibernate will assign identifiers when an object is saved. You ""can see that Hibernate can access public, private, and protected accessor ""methods, as well as (public, private, protected) fields directly. The choice ""is up to you and you can match it to fit your application design."msgstr """La propriété <literal>id</literal> contient la valeur d'un identifiant ""unique pour un événement particulier. Toutes les classes d'entités ""persistantes (ainsi que les classes dépendantes de moindre importance) ""auront besoin d'une telle propriété identifiante si nous voulons utiliser ""l'ensemble complet des fonctionnalités d'Hibernate. En fait, la plupart des ""applications (surtout les applications web) ont besoin de distinguer des ""objets par des identifiants, donc vous devriez considérer ça comme une ""fonctionnalité plutôt que comme une limitation. Cependant, nous ne ""manipulons généralement pas l'identité d'un objet, dorénavant la méthode ""setter devrait être privée. Seul Hibernate assignera les identifiants ""lorsqu'un objet est sauvegardé. Vous pouvez voir qu'Hibernate peut accéder ""aux méthodes publiques, privées et protégées, ainsi qu'aux champs (publics, ""privés, protégés) directement. Le choix vous est laissé, et vous pouvez ""l'ajuster à la conception de votre application."#. Tag: para#: tutorial.xml:145#, no-c-formatmsgid """The no-argument constructor is a requirement for all persistent classes; ""Hibernate has to create objects for you, using Java Reflection. The ""constructor can be private, however, package visibility is required for ""runtime proxy generation and efficient data retrieval without bytecode ""instrumentation."msgstr """Le constructeur sans argument est requis pour toutes les classes ""persistantes ; Hibernate doit créer des objets pour vous en utilisant la ""réflexion Java. Le constructeur peut être privé, cependant, la visibilité du ""paquet est requise pour la génération de proxy à l'exécution et une ""récupération des données efficaces sans instrumentation du bytecode."#. Tag: para#: tutorial.xml:152#, no-c-formatmsgid """Place this Java source file in a directory called <literal>src</literal> in ""the development folder, and in its correct package. The directory should now ""look like this:"msgstr """Placez ce fichier source Java dans un répertoire appelé <literal>src</""literal> dans le dossier de développement. Ce répertoire devrait maintenant ""ressembler à ça :"#. Tag: programlisting#: tutorial.xml:157#, no-c-formatmsgid """<![CDATA[.\n""+lib\n""  <Hibernate and third-party libraries>\n""+src\n""  +events\n""    Event.java]]>"msgstr ""#. Tag: para#: tutorial.xml:159#, no-c-formatmsgid "In the next step, we tell Hibernate about this persistent class."msgstr """Dans la prochaine étape, nous informons Hibernate de cette classe ""persistante."#. Tag: title#: tutorial.xml:166#, no-c-formatmsgid "The mapping file"msgstr "Le fichier de mapping"#. Tag: para#: tutorial.xml:168#, no-c-formatmsgid """Hibernate needs to know how to load and store objects of the persistent ""class. This is where the Hibernate mapping file comes into play. The mapping ""file tells Hibernate what table in the database it has to access, and what ""columns in that table it should use."msgstr """Hibernate a besoin de savoir comment charger et stocker des objets d'une ""classe persistante. C'est là qu'intervient le fichier de mapping Hibernate. ""Le fichier de mapping indique à Hibernate à quelle table dans la base de ""données il doit accéder, et quelles colonnes de cette table il devra ""utiliser."#. Tag: para#: tutorial.xml:175#, no-c-formatmsgid "The basic structure of a mapping file looks like this:"msgstr "La structure basique de ce fichier de mapping ressemble à ça :"#. Tag: programlisting#: tutorial.xml:179#, no-c-formatmsgid ""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -