📄 tutorial.po
字号:
msgstr "Hibernate 구성"#. Tag: para#: tutorial.xml:239#, no-c-formatmsgid """We now have a persistent class and its mapping file in place. It is time to ""configure Hibernate. Before we do this, we will need a database. HSQL DB, a ""java-based SQL DBMS, can be downloaded from the HSQL DB website(http://""hsqldb.org/). Actually, you only need the <literal>hsqldb.jar</literal> from ""this download. Place this file in the <literal>lib/</literal> directory of ""the development folder."msgstr """우리는 이제 적절한 곳에 한 개의 영속 클래스와 그것의 매핑 파일을 갖고 있다. ""Hibernate를 구성할 차례이다. 우리가 이것을 행하기 전에, 우리는 데이터베이스""를 필요로 할 것이다. 자바 기반의 메모리-내 SQL DBMS인 HSQL DB는 HSQL DB 웹 사""이트에서 내려받을 수 있다. 실제로, 당신은 이 다운로드에서 오직 ""<literal>hsqldb.jar</literal> 만을 필요로 한다. 개발 폴더의 <literal>lib/</""literal> 디렉토리 속에 이 파일을 위치지워라."#. Tag: para#: tutorial.xml:247#, no-c-formatmsgid """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 """개발 디렉토리의 루트에 <literal>data</literal>로 명명된 디렉토리를 생성시켜""라 - 이 디렉토리는 HSQL DB가 그것의 데이터 파일들을 저장하게 될 장소이다. 이""제 이 데이터 디렉토리에서 <literal>java -classpath ../lib/hsqldb.jar org.""hsqldb.Server</literal>를 실행시켜서 데이터베이스를 시작시켜라. 당신은 그것""이 시작되고 이것은 우리의 어플리케이션이 나중에 연결하게 될 장소인, 하나의 ""TCP/IP 소켓에 바인드 되는 것을 볼 수 있다. 만일 이 튜토리얼 동안에 당신이 새 ""데이터베이스로 시작하고자 원할 경우, HSQL DB를 셧다운시키고(왼도우에서 ""<literal>CTRL + C</literal>를 눌러라), <literal>data/</literal> 디렉토리 내""에 있는 모든 파일들을 삭제하고 다시 HSQL DB를 시작하라."#. Tag: para#: tutorial.xml:257#, no-c-formatmsgid """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는 당신의 어플리케이션 내에서 이 데이터베이스에 연결하는 계층이고, ""따라서 그것은 커넥션 정보를 필요로 한다. 커넥션들은 마찬가지로 구성되어야 하""는 하나의 JDBC 커넥션 풀을 통해 행해진다. Hibernate 배포본은 몇몇 오픈 소스 ""JDBC 커넥션 풀링 도구들을 포함하고 있지만, 이 튜토리얼에서는 Hibernate에 의""해 미리 빌드된 커넥션 풀링을 사용할 것이다. 당신이 필수 라이브러리를 당신의 ""classpath 속에 복사해야 하고 만일 당신이 제품-특징의 제3의 JDBC 풀링 소프트웨""어를 사용하고자 원할 경우에는 다른 커넥션 풀링 설정들을 사용해야 함을 노트하""라."#. Tag: para#: tutorial.xml:267#, no-c-formatmsgid """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 """Hibernate의 구성을 위해, 우리는 한 개의 간단한 <literal>hibernate.""properties</literal> 파일, 한 개의 약간 더 세련된 <literal>hibernate.cfg.""xml</literal> 파일, 또는 심지어 완전한 프로그램 상의 설정을 사용할 수 있다. ""대부분의 사용자들은 XMl 구성 파일을 선호한다:"#. Tag: programlisting#: tutorial.xml:273#, no-c-formatmsgid """<![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 ""#. Tag: para#: tutorial.xml:275#, no-c-formatmsgid """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 """이 XML 구성이 다른 DTD를 사용함을 노트하라. 우리는 Hibernate의 ""<literal>SessionFactory</literal> -특정 데이터베이스에 대해 책임이 있는 전역 ""팩토리-를 구성한다. 만일 당신이 여러 데이터베이스들을 갖고 있다면, (보다 쉬""운 시작을 위해) 몇 개의 구성 파일들 속에 여러 개의 <literal><session-""factory></literal> 구성들을 사용하라."#. Tag: para#: tutorial.xml:283#, no-c-formatmsgid """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 """처음 네 개의 <literal>property</literal> 요소들은 JDBC 커넥션을 위한 필수 구""성을 포함한다. dialect <literal>property</literal> 요소는 Hibernate가 발생시""키는 특별한 SQL 이형(異形)을 지정한다. <literal>hbm2ddl.auto</literal> 옵션""은 -직접 데이터베이스 속으로- 데이터베이스 스키마의 자동적인 생성을 활성화 시""킨다. 물론 이것은 (config 옵션을 제거함으로써) 비활성화 시킬 수 있거나 ""<literal>SchemaExport</literal> Ant 태스크의 도움으로 파일로 리다이렉트 될 ""수 있다. 마지막으로 우리는 영속 클래스들을 위한 매핑 파일(들)을 추가시킨다."#. Tag: para#: tutorial.xml:296#, no-c-formatmsgid """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 """이 파일을 소스 디렉토리 속으로 복사하고, 따라서 그것은 classpath의 루트에서 ""끝날 것이다. Hibernate는 시작 시에 classpath의 루트에서 <literal>hibernate.""cfg.xml</literal>로 명명된 파일을 자동적으로 찾는다."#. Tag: title#: tutorial.xml:305#, no-c-formatmsgid "Building with Ant"msgstr "Ant로 빌드하기"#. Tag: para#: tutorial.xml:307#, no-c-formatmsgid """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 """우리는 이제 Ant로 튜토리얼을 빌드할 것이다. 당신은 Ant를 설치할 필요가 있을 ""것이다 - <ulink url=\"http://ant.apache.org/bindownload.cgi\">Ant 내려받기 페""이지</ulink>에서 Ant를 얻어라. Ant를 설치하는 방법은 여기서 다루지 않을 것이""다. <ulink url=\"http://ant.apache.org/manual/index.html\">Ant 매뉴얼</ulink>""을 참조하길 바란다. 당신이 Ant를 설치한 후에, 우리는 빌드파일 생성을 시작할 ""수 있다. 그것은 <literal>build.xml</literal>로 명명되고 개발 디렉토리 속에 직""접 위치될 것이다."#. Tag: para#: tutorial.xml:316#, no-c-formatmsgid "A basic build file looks like this:"msgstr "기본 빌드 파일은 다음과 같다:"#. Tag: programlisting#: tutorial.xml:320#, no-c-formatmsgid """<![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 ""#. Tag: para#: tutorial.xml:322#, no-c-formatmsgid """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 """이것은 <literal>.jar</literal>로 끝나는 lib 디렉토리 내에 있는 모든 파일들을 ""컴파일에 사용되는 classpath에 추가하도록 Ant에게 알려줄 것이다. 그것은 또한 ""모든 비-Java 소스 파일들을 대상 디렉토리로 복사할 것이다. 예를 들면, 구성 및 ""Hibernate 매핑 파일들. 만일 당신이 Ant를 이제 실행할 경우, 당신은 다음 출력""을 얻게 될 것이다:"#. Tag: programlisting#: tutorial.xml:329#, no-c-formatmsgid """<![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 ""#. Tag: title#: tutorial.xml:334#, no-c-formatmsgid "Startup and helpers"msgstr "시작과 helper들"#. Tag: para#: tutorial.xml:336#, no-c-formatmsgid """It's time to load and store some <literal>Event</literal> objects, but first ""we have to complete the setup with some infrastructure code. We have to ""startup Hibernate. This startup includes building a global ""<literal>SessionFactory</literal> object and to store it somewhere for easy ""access in application code. A <literal>SessionFactory</literal> can open up ""new <literal>Session</literal>'s. A <literal>Session</literal> represents a "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -