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

📄 tutorial.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgstr """Tenemos ahora una clase persistente y su fichero de mapeo en su sitio. Es ""momento de configurar Hibernate. Antes que hagamos esto, necesitaremos una ""base de datos. HSQL DB, un DBMS SQL en-memoria basado en Java, puede ser ""descargado del sitio web de HSQL DB. Realmente, de esta descarga s&#x00f3;lo ""necesitas el <literal>hsqldb.jar</literal>. Coloca este fichero en el ""directorio <literal>lib/</literal> de la carpeta de desarrollo."#: index.docbook:247msgid """Create a directory called <literal>data</literal> in the root of the ""development directory - this is where HSQL DB will store its data files. Now ""start the database by running <literal>java -classpath ../lib/hsqldb.jar org.""hsqldb.Server</literal> in this data directory. You can see it start up and ""bind to a TCP/IP socket, this is where our application will connect later. ""If you want to start with a fresh database during this tutorial, shutdown ""HSQL DB (press <literal>CTRL + C</literal> in the window), delete all files ""in the <literal>data/</literal> directory, and start HSQL DB again."msgstr """Crea un directorio llamado <literal>data</literal> en la ra&#x00ed;z del ""directorio de desarrollo. All&#x00ed; es donde HSQL DB almacenar&#x00e1; sus ""ficheros de datos."#: index.docbook:257msgid """Hibernate is the layer in your application which connects to this database, ""so it needs connection information. The connections are made through a JDBC ""connection pool, which we also have to configure. The Hibernate distribution ""contains several open source JDBC connection pooling tools, but will use the ""Hibernate built-in connection pool for this tutorial. Note that you have to ""copy the required library into your classpath and use different connection ""pooling settings if you want to use a production-quality third party JDBC ""pooling software."msgstr """Hibernate es la capa en tu aplicaci&#x00f3;n que se conecta a esta base de ""datos, de modo que necesita informaci&#x00f3;n de conexi&#x00f3;n. Las ""conexiones se hacen a trav&#x00e9;s de un pool de conexiones JDBC, que ""tamb&#x00e9;n tenemos que configurar. La distribuci&#x00f3;n de Hibernate ""contiene muchas herramientas de pooling de conexiones JDBC de c&#x00f3;digo ""abierto, pero para este tutorial usaremos el pool de conexiones prefabricado ""dentro de Hibernate. Observa que tienes que copiar la biblioteca requerida ""en tu classpath y usar diferentes configuraciones de pooling de conexiones ""si quieres usar un software de pooling JDBC de terceros de calidad de ""producci&#x00f3;n."#: index.docbook:267msgid """For Hibernate's configuration, we can use a simple <literal>hibernate.""properties</literal> file, a slightly more sophisticated <literal>hibernate.""cfg.xml</literal> file, or even complete programmatic setup. Most users ""prefer the XML configuration file:"msgstr """Para la configuraci&#x00f3;n de Hibernate, podemos usar un fichero ""<literal>hibernate.properties</literal> simple, un fichero ""<literal>hibernate.cfg.xml</literal> ligeramente m&#x00e1;s sofisticado, o ""incluso una configuraci&#x00f3;n completamente program&#x00e1;tica. La ""mayor&#x00ed;a de los usuarios prefieren el fichero de configuraci&#x00f3;n ""XML:"#: index.docbook:273msgid """<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n""<!DOCTYPE hibernate-configuration PUBLIC\n""        \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n""        \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd""\">\n""\n""<hibernate-configuration>\n""\n""    <session-factory>\n""\n""        <!-- Database connection settings -->\n""        <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</""property>\n""        <property name=\"connection.url\">jdbc:hsqldb:hsql://localhost</""property>\n""        <property name=\"connection.username\">sa</property>\n""        <property name=\"connection.password\"></property>\n""\n""        <!-- JDBC connection pool (use the built-in) -->\n""        <property name=\"connection.pool_size\">1</property>\n""\n""        <!-- SQL dialect -->\n""        <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</""property>\n""\n""        <!-- Enable Hibernate's automatic session context management -->\n""        <property name=\"current_session_context_class\">thread</property>\n""\n""        <!-- Disable the second-level cache  -->\n""        <property name=\"cache.provider_class\">org.hibernate.cache.""NoCacheProvider</property>\n""\n""        <!-- Echo all executed SQL to stdout -->\n""        <property name=\"show_sql\">true</property>\n""\n""        <!-- Drop and re-create the database schema on startup -->\n""        <property name=\"hbm2ddl.auto\">create</property>\n""\n""        <mapping resource=\"events/Event.hbm.xml\"/>\n""\n""    </session-factory>\n""\n""</hibernate-configuration>]]>"msgstr """<![CDATA[<?xml version='1.0' encoding='utf-8'?>\n""<!DOCTYPE hibernate-configuration PUBLIC\n""        \"-//Hibernate/Hibernate Configuration DTD 3.0//EN\"\n""        \"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd""\">\n""\n""<hibernate-configuration>\n""\n""    <session-factory>\n""\n""        <!-- Database connection settings -->\n""        <property name=\"connection.driver_class\">org.hsqldb.jdbcDriver</""property>\n""        <property name=\"connection.url\">jdbc:hsqldb:data/tutorial</""property>\n""        <property name=\"connection.username\">sa</property>\n""        <property name=\"connection.password\"></property>\n""\n""        <!-- JDBC connection pool (use the built-in) -->\n""        <property name=\"connection.pool_size\">1</property>\n""\n""        <!-- SQL dialect -->\n""        <property name=\"dialect\">org.hibernate.dialect.HSQLDialect</""property>\n""\n""        <!-- Echo all executed SQL to stdout -->\n""        <property name=\"show_sql\">true</property>\n""\n""        <!-- Drop and re-create the database schema on startup -->\n""        <property name=\"hbm2ddl.auto\">create</property>\n""\n""        <mapping resource=\"Event.hbm.xml\"/>\n""\n""    </session-factory>\n""\n""</hibernate-configuration>]]>"#: index.docbook:275msgid """Note that this XML configuration uses a different DTD. We configure ""Hibernate's <literal>SessionFactory</literal> - a global factory responsible ""for a particular database. If you have several databases, use several ""<literal>&lt;session-factory&gt;</literal> configurations, usually in ""several configuration files (for easier startup)."msgstr """Observa que esta configuraci&#x00f3;n XML usa un DTD diferente. Configuramos ""la <literal>SessionFactory</literal> de Hibernate, una f&#x00e1;brica global ""responsable de una base de datos en particular. Si tienes varias bases de ""datos, usa varias configuraciones <literal>&lt;session-factory&gt;</""literal> , usualmente en varios ficheros de configuraci&#x00f3;n (para un ""arranque m&#x00e1;s f&#x00e1;cil)."#: index.docbook:283msgid """The first four <literal>property</literal> elements contain the necessary ""configuration for the JDBC connection. The dialect <literal>property</""literal> element specifies the particular SQL variant Hibernate generates. ""Hibernate's automatic session management for persistence contexts will come ""in handy as you will soon see. The <literal>hbm2ddl.auto</literal> option ""turns on automatic generation of database schemas - directly into the ""database. This can of course also be turned off (by removing the config ""option) or redirected to a file with the help of the <literal>SchemaExport</""literal> Ant task. Finally, we add the mapping file(s) for persistent ""classes to the configuration."msgstr """Los primeros cuatro elementos <literal>property</literal> contienen la ""configuraci&#x00f3;n necesaria para la conexi&#x00f3;n JDBC. El elemento de ""dialecto <literal>property</literal> especifica la variante de SQL en ""particular que genera Hibernate. La opci&#x00f3;n <literal>hbm2ddl.auto</""literal> activa la generaci&#x00f3;n autom&#x00e1;tica de esquemas de base ""de datos, directamente en la base de datos. Esto, por supuesto, puede ""desactivarse (quitando la opci&#x00f3;n config) o redirigido a un fichero ""con la ayuda de la tarea de Ant <literal>SchemaExport</literal>. Finalmente, ""agregamos el(los) fichero(s) de mapeo para clases persistentes."#: index.docbook:296msgid """Copy this file into the source directory, so it will end up in the root of ""the classpath. Hibernate automatically looks for a file called ""<literal>hibernate.cfg.xml</literal> in the root of the classpath, on ""startup."msgstr """Copia este fichero dentro del directorio de c&#x00f3;digo fuente, de modo ""que termine ubicado en la rai&#x00ed;z del classpath. Hibernate busca ""autom&#x00e1;ticamente un fichero llamado <literal>hibernate.cfg.xml</""literal> en la ra&#x00ed;z del classpath al arrancar."#: index.docbook:305msgid "Building with Ant"msgstr "Construyendo con Ant"#: index.docbook:307msgid """We'll now build the tutorial with Ant. You will need to have Ant installed - ""get it from the <ulink url=\"http://ant.apache.org/bindownload.cgi\">Ant ""download page</ulink>. How to install Ant will not be covered here. Please ""refer to the <ulink url=\"http://ant.apache.org/manual/index.html\">Ant ""manual</ulink>. After you have installed Ant, we can start to create the ""buildfile. It will be called <literal>build.xml</literal> and placed ""directly in the development directory."msgstr """Construiremos ahora el tutorial con Ant. Necesitar&#x00e1;s tener Ant ""instalado. Obt&#x00e9;nlo de <ulink url=\"http://ant.apache.org/bindownload.""cgi\">P&#x00e1;gina de descarga de Ant</ulink>. No se cubrir&#x00e1; ""aqu&#x00ed; c&#x00f3;mo instalar Ant. Por favor refi&#x00e9;rete al <ulink ""url=\"http://ant.apache.org/manual/index.html\"> Manual de Ant</ulink>. ""Despu&#x00e9;s que hayas instalado Ant, podemos comenzar a crear el ""buildfile. Ser&#x00e1; llamado <literal>build.xml</literal> y colocado ""directamente en el directorio de desarrollo."#: index.docbook:316msgid "A basic build file looks like this:"msgstr "Reparar Ant"#: index.docbook:320msgid """<![CDATA[<project name=\"hibernate-tutorial\" default=\"compile\">\n""\n""    <property name=\"sourcedir\" value=\"${basedir}/src\"/>\n""    <property name=\"targetdir\" value=\"${basedir}/bin\"/>\n""    <property name=\"librarydir\" value=\"${basedir}/lib\"/>\n""\n""    <path id=\"libraries\">\n""        <fileset dir=\"${librarydir}\">\n""            <include name=\"*.jar\"/>\n""        </fileset>\n""    </path>\n""\n""    <target name=\"clean\">\n""        <delete dir=\"${targetdir}\"/>\n""        <mkdir dir=\"${targetdir}\"/>\n""    </target>\n""\n""    <target name=\"compile\" depends=\"clean, copy-resources\">\n""      <javac srcdir=\"${sourcedir}\"\n""             destdir=\"${targetdir}\"\n""             classpathref=\"libraries\"/>\n""    </target>\n""\n""    <target name=\"copy-resources\">\n""        <copy todir=\"${targetdir}\">\n""            <fileset dir=\"${sourcedir}\">\n""                <exclude name=\"**/*.java\"/>\n""            </fileset>\n""        </copy>\n""    </target>\n""\n""</project>]]>"msgstr """Observa que la distribuci&#x00f3;n de Ant est&#x00e1; por defecto rota (como ""se describe en el FAQ de Ant) y tiene que ser reparado por ti, por ejemplo, ""si quisieras usar JUnit desde dentro de tu fichero de construcci&#x00f3;n. ""Para hacer que funcione la tarea de JUnit (no lo necesitaremos en este ""tutorial), copia junit.jar a <literal>ANT_HOME/lib</literal> o quita el ""trozo de plugin <literal>ANT_HOME/lib/ant-junit.jar</literal>."#: index.docbook:322msgid """This will tell Ant to add all files in the lib directory ending with ""<literal>.jar</literal> to the classpath used for compilation. It will also ""copy all non-Java source files to the target directory, e.g. configuration ""and Hibernate mapping files. If you now run Ant, you should get this output:"msgstr "Un fichero de construcci&#x00f3;n b&#x00e1;sico se ve como esto:"#: index.docbook:329msgid """<![CDATA[C:\\hibernateTutorial\\>ant\n""Buildfile: build.xml\n""\n""copy-resources:\n""     [copy] Copying 2 files to C:\\hibernateTutorial\\bin\n""\n""compile:\n""    [javac] Compiling 1 source file to C:\\hibernateTutorial\\bin\n""\n""BUILD SUCCESSFUL\n""Total time: 1 second ]]>"msgstr """<![CDATA[<project name=\"hibernate-tutorial\" default=\"compile\">\n""\n""    <property name=\"sourcedir\" value=\"${basedir}/src\"/>\n""    <property name=\"targetdir\" value=\"${basedir}/bin\"/>\n""    <property name=\"librarydir\" value=\"${basedir}/lib\"/>\n""\n""    <path id=\"libraries\">\n""        <fileset dir=\"${librarydir}\">\n""            <include name=\"*.jar\"/>\n""        </fileset>\n""    </path>\n""\n""    <target name=\"clean\">\n""        <delete dir=\"${targetdir}\"/>\n""        <mkdir dir=\"${targetdir}\"/>\n""    </target>\n""\n""    <target name=\"compile\" depends=\"clean, copy-resources\">\n""      <javac srcdir=\"${sourcedir}\"\n""             destdir=\"${targetdir}\"\n""             classpathref=\"libraries\"/>\n""    </target>\n""\n""    <target name=\"copy-resources\">\n""        <copy todir=\"${targetdir}\">\n""            <fileset dir=\"${sourcedir}\">\n""                <exclude name=\"**/*.java\"/>\n""            </fileset>\n""        </copy>\n""    </target>\n""\n""</project>]]>"#: index.docbook:334

⌨️ 快捷键说明

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