📄 tutorial.po
字号:
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ó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íz del ""directorio de desarrollo. Allí es donde HSQL DB almacenará 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ón que se conecta a esta base de ""datos, de modo que necesita información de conexión. Las ""conexiones se hacen a través de un pool de conexiones JDBC, que ""tambén tenemos que configurar. La distribución de Hibernate ""contiene muchas herramientas de pooling de conexiones JDBC de có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ó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ón de Hibernate, podemos usar un fichero ""<literal>hibernate.properties</literal> simple, un fichero ""<literal>hibernate.cfg.xml</literal> ligeramente más sofisticado, o ""incluso una configuración completamente programática. La ""mayoría de los usuarios prefieren el fichero de configuració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><session-factory></literal> configurations, usually in ""several configuration files (for easier startup)."msgstr """Observa que esta configuración XML usa un DTD diferente. Configuramos ""la <literal>SessionFactory</literal> de Hibernate, una fábrica global ""responsable de una base de datos en particular. Si tienes varias bases de ""datos, usa varias configuraciones <literal><session-factory></""literal> , usualmente en varios ficheros de configuración (para un ""arranque más fá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ón necesaria para la conexión JDBC. El elemento de ""dialecto <literal>property</literal> especifica la variante de SQL en ""particular que genera Hibernate. La opción <literal>hbm2ddl.auto</""literal> activa la generación automática de esquemas de base ""de datos, directamente en la base de datos. Esto, por supuesto, puede ""desactivarse (quitando la opció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ódigo fuente, de modo ""que termine ubicado en la raiíz del classpath. Hibernate busca ""automáticamente un fichero llamado <literal>hibernate.cfg.xml</""literal> en la raí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ás tener Ant ""instalado. Obténlo de <ulink url=\"http://ant.apache.org/bindownload.""cgi\">Página de descarga de Ant</ulink>. No se cubrirá ""aquí cómo instalar Ant. Por favor refiérete al <ulink ""url=\"http://ant.apache.org/manual/index.html\"> Manual de Ant</ulink>. ""Después que hayas instalado Ant, podemos comenzar a crear el ""buildfile. Será 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ón de Ant está 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ó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ón bá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 + -