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

📄 session_api.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 07:47+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:5#, no-c-formatmsgid "Working with objects"msgstr "Trabalhando com objetos"#. Tag: para#: session_api.xml:7#, 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 """O Hibernate é uma solução completa de mapeamento objeto/relacional que não ""apenas poupa o desenvolvedor dos detalhes de baixo nível do sistema de ""gerenciamento do banco de dados, mas também oferece um ""<emphasis>gerenciamento de estado </emphasis> para objetos. Isto é, ao ""contrário do gerenciamento de <literal>instruções </literal> SQL em camadas ""de persistência JDBC/SQL comuns, uma visão natural da persistência orientada ""a objetos em aplicações Java."#. Tag: para#: session_api.xml:16#, 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 """Em outras palavras, desenvolvedores de aplicações Hibernate podem sempre ""pensar em relação ao <emphasis>estado</emphasis> de seus objetos, e não ""necessariamente em relação a execução de instruções SQL. Este parte é ""responsabilidade do Hibernate e é relevante aos desenvolvedores de ""aplicações apenas quando estão ajustando a performance do sistema."#. Tag: title#: session_api.xml:24#, no-c-formatmsgid "Hibernate object states"msgstr "Estado dos objetos no Hibernate"#. Tag: para#: session_api.xml:26#, no-c-formatmsgid "Hibernate defines and supports the following object states:"msgstr "O Hibernate define e suporta os seguintes estados de um objetos:"#. Tag: para#: session_api.xml:32#, 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>Transient</emphasis> - um objeto é transiente se ele foi ""instanciando usando apenas o operador <literal>new</literal>, e não foi ""associado com uma <literal>Session</literal> do Hibernate. Ele não terá uma ""representação persistente no banco de dados e nenhum identificador será ""atribuído para ele. Instâncias transientes serão destruídas pelo coletor de ""lixo se a aplicação não manter sua referência. Use uma <literal>Session</""literal> do Hibernate para tornar o objeto persistente ( e deixe o Hibernate ""gerenciar as instruções SQL que serão necessárias para executar esta ""transição)."#. Tag: para#: session_api.xml:44#, 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>Persistent</emphasis> -– uma instância persistente possui uma ""representação no banco de dados e um identificador. Ele pode ter sido salvo ""ou carregado, assim, ele está por definição no escopo de uma ""<literal>Session</literal>. O Hibernate irá detectar qualquer mudança feita ""a um objeto persistente e sincronizar o seu estado com o banco de dados ""quando completar a unidade de trabalho. Desenvolvedores não executam ""instruções manuais de <literal>UPDATE</literal>, ou instruções de ""<literal>DELETE</literal> quando o objeto deve ser passado para transiente."#. Tag: para#: session_api.xml:55#, 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>Detached</emphasis> – uma instância desaclopada é um objeto que ""foi persistido, mas sua <literal>Session</literal> foi fechada. A referência ""ao objeto continua válida, é claro, e a instância destacada desaclopada pode ""ser acoplada a uma nova <literal>Session</literal> no futuro, fazendo-o ( e ""todas as modificações sofridas) persistente novamente. Essa característica ""possibilita um modelo de programação para unidades de trabalho que rodam ""durante muito tempo que requer um pensamento por tempo do usuário. Podemos ""chamar-las de <emphasis>transações da aplicação</emphasis>, i.e. uma unidade ""de trabalho do ponto de vista do usuário."#. Tag: para#: session_api.xml:69#, no-c-formatmsgid """We'll now discuss the states and state transitions (and the Hibernate ""methods that trigger a transition) in more detail."msgstr """Agora iremos discutir os estados e suas transições ( e os métodos do ""Hibernate que disparam uma transição) em mais detalhes."#. Tag: title#: session_api.xml:77#, no-c-formatmsgid "Making objects persistent"msgstr "Tornando os objetos persistentes"#. Tag: para#: session_api.xml:79#, 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 """Instâncias recentemente instanciadas de uma classe persistente são ""consideradas <emphasis>transientes </emphasis> pelo Hibernate. Podemos ""tornar uma instância transiente em <emphasis>persistente</emphasis> ""associando-a a uma sessão:"#. Tag: programlisting#: session_api.xml:86#, 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:88#, 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 """Se <literal>Cat</literal> possui um identificador gerado, o identificador é ""gerado e atribuído a <literal>cat</literal> quando <literal>save()</literal> ""for chamada. Se <literal>Cat</literal> possuir um identificador ""<literal>Associado</literal>, ou uma chave composta, o identificador deve ""ser atribuído à instância de <literal>cat</literal> antes que <literal>save()""</literal> seja chamado. Pode-se usar também <literal>persist()</literal> ao ""invés de <literal>save()</literal>, com a semântica definada no novo esboço ""do EJB3."#. Tag: para#: session_api.xml:100#, 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:111#, 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:121#, no-c-formatmsgid """Alternatively, you may assign the identifier using an overloaded version of ""<literal>save()</literal>."msgstr """Alternativamente, pode-se atribuir o identificador usando uma versão ""sobrecarregada de <literal>save()</literal>."#. Tag: programlisting#: session_api.xml:126#, 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:128#, 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 """Se o objeto persistido possuir objetos associados (e.g. a coleção ""<literal>kittens</literal> no exemplo anterior), esses objetos podem ser ""tornar persistente em qualquer ordem que se queira ao menos que se tenha uma ""restrição <literal>NOT NULL</literal> em uma coluna de chave estrangeira. ""Nunca há risco de violação de restrições de chave estrangeira. Assim, pode-""se violar uma restrição <literal>NOT NULL</literal> se <literal>save()</""literal> for usada nos objetos em uma ordem errada."#. Tag: para#: session_api.xml:138#, 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 """Geralmente você não deve se importar com esses detalhes, muito provavelmente ""se usará a característica de <emphasis>persistência transitiva </emphasis> ""do Hibernate para salvar os objetos associados automaticamente. Então, ""enquanto uma restrição <literal>NOT NULL</literal> não ocorrer – Hibernate ""tomará conta de tudo. Persistência transitiva será discutida futuramente ""nesse capítulo."#. Tag: title#: session_api.xml:149#, no-c-formatmsgid "Loading an object"msgstr "Carregando o objetos"#. Tag: para#: session_api.xml:151#, 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 """O método <literal>load()</literal> de uma <literal> Session</literal> nos ""fornece um meio para recuperar uma instância persistente se o identificador ""for conhecido. <literal>load()</literal> recebe uma classe do objeto e ""carregará o estado em uma instância mais recente dessa classe, no estado ""persistente."#. Tag: programlisting#: session_api.xml:158#, no-c-formatmsgid "<![CDATA[Cat fritz = (Cat) sess.load(Cat.class, generatedId);]]>"msgstr ""#. Tag: programlisting#: session_api.xml:160#, 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:162#, no-c-formatmsgid "Alternatively, you can load state into a given instance:"msgstr """Alternatively, you can load state into a given instance: Alternativamente, ""pode-se carregar um estado em uma instância dada:"#. Tag: programlisting#: session_api.xml:166#, no-c-formatmsgid """<![CDATA[Cat cat = new DomesticCat();\n""// load pk's state into cat\n""sess.load( cat, new Long(pkId) );\n""Set kittens = cat.getKittens();]]>"msgstr ""#. Tag: para#: session_api.xml:168#, no-c-formatmsgid """Note that <literal>load()</literal> will throw an unrecoverable exception if "

⌨️ 快捷键说明

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