📄 query_criteria.po
字号:
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#: query_criteria.xml:29#, no-c-formatmsgid "Criteria Queries"msgstr "Requêtes par critères"#. Tag: para#: query_criteria.xml:31#, no-c-formatmsgid "Hibernate features an intuitive, extensible criteria query API."msgstr """Hibernate offre une API d'interrogation par critères intuitive et extensible."#. Tag: title#: query_criteria.xml:36#, no-c-formatmsgid "Creating a <literal>Criteria</literal> instance"msgstr "Créer une instance de <literal>Criteria</literal>"#. Tag: para#: query_criteria.xml:38#, no-c-formatmsgid """The interface <literal>org.hibernate.Criteria</literal> represents a query ""against a particular persistent class. The <literal>Session</literal> is a ""factory for <literal>Criteria</literal> instances."msgstr """L'interface <literal>net.sf.hibernate.Criteria</literal> représente une ""requête sur une classe persistente donnée. La <literal>Session</literal> ""fournit les instances de <literal>Criteria</literal>."#. Tag: programlisting#: query_criteria.xml:44#, no-c-formatmsgid """<![CDATA[Criteria crit = sess.createCriteria(Cat.class);\n""crit.setMaxResults(50);\n""List cats = crit.list();]]>"msgstr ""#. Tag: title#: query_criteria.xml:49#, no-c-formatmsgid "Narrowing the result set"msgstr "Restriction du résultat"#. Tag: para#: query_criteria.xml:51#, no-c-formatmsgid """An individual query criterion is an instance of the interface <literal>org.""hibernate.criterion.Criterion</literal>. The class <literal>org.hibernate.""criterion.Restrictions</literal> defines factory methods for obtaining ""certain built-in <literal>Criterion</literal> types."msgstr """Un criterion (critère de recherche) est une instance de l'interface ""<literal>org.hibernate.criterion.Criterion</literal>. La classe <literal>org.""hibernate.criterion.Restrictions</literal> définit des méthodes pour obtenir ""des types de <literal>Criterion</literal> pré-définis."#. Tag: programlisting#: query_criteria.xml:59#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.like(\"name\", \"Fritz%\") )\n"" .add( Restrictions.between(\"weight\", minWeight, maxWeight) )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:61#, no-c-formatmsgid "Restrictions may be grouped logically."msgstr "Les restrictions peuvent être goupées de manière logique."#. Tag: programlisting#: query_criteria.xml:65#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.like(\"name\", \"Fritz%\") )\n"" .add( Restrictions.or(\n"" Restrictions.eq( \"age\", new Integer(0) ),\n"" Restrictions.isNull(\"age\")\n"" ) )\n"" .list();]]>"msgstr ""#. Tag: programlisting#: query_criteria.xml:67#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.in( \"name\", new String[] { \"Fritz\", \"Izi\", \"Pk""\" } ) )\n"" .add( Restrictions.disjunction()\n"" .add( Restrictions.isNull(\"age\") )\n"" .add( Restrictions.eq(\"age\", new Integer(0) ) )\n"" .add( Restrictions.eq(\"age\", new Integer(1) ) )\n"" .add( Restrictions.eq(\"age\", new Integer(2) ) )\n"" ) )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:69#, no-c-formatmsgid """There are quite a range of built-in criterion types (<literal>Restrictions</""literal> subclasses), but one that is especially useful lets you specify SQL ""directly."msgstr """Il y a plusieurs types de criterion pré-définis (sous classes de ""<literal>Restriction</literal>), mais l'une d'entre elle particulièrement ""utile vous permet de spécifier directement du SQL."#. Tag: programlisting#: query_criteria.xml:74#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.sqlRestriction(\"lower({alias}.name) like lower(?)\", ""\"Fritz%\", Hibernate.STRING) )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:76#, no-c-formatmsgid """The <literal>{alias}</literal> placeholder with be replaced by the row alias ""of the queried entity."msgstr """La zone <literal>{alias}</literal> sera remplacée par l'alias de colonne de ""l'entité que l'on souhaite intérroger."#. Tag: para#: query_criteria.xml:81#, no-c-formatmsgid """An alternative approach to obtaining a criterion is to get it from a ""<literal>Property</literal> instance. You can create a <literal>Property</""literal> by calling <literal>Property.forName()</literal>."msgstr """Une autre approche pour obtenir un criterion est de le récupérer d'une ""instance de <literal>Property</literal>. Vous pouvez créer une ""<literal>Property</literal> en appelant <literal>Property.forName()</""literal>."#. Tag: programlisting#: query_criteria.xml:87#, no-c-formatmsgid """<![CDATA[\n""Property age = Property.forName(\"age\");\n""List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.disjunction()\n"" .add( age.isNull() )\n"" .add( age.eq( new Integer(0) ) )\n"" .add( age.eq( new Integer(1) ) )\n"" .add( age.eq( new Integer(2) ) )\n"" ) )\n"" .add( Property.forName(\"name\").in( new String[] { \"Fritz\", \"Izi\", ""\"Pk\" } ) )\n"" .list();]]>"msgstr ""#. Tag: title#: query_criteria.xml:92#, no-c-formatmsgid "Ordering the results"msgstr "Trier les résultats"#. Tag: para#: query_criteria.xml:94#, no-c-formatmsgid """You may order the results using <literal>org.hibernate.criterion.Order</""literal>."msgstr """Vous pouvez trier les résultats en utilisant <literal>org.hibernate.""criterion.Order</literal>."#. Tag: programlisting#: query_criteria.xml:98#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.like(\"name\", \"F%\")\n"" .addOrder( Order.asc(\"name\") )\n"" .addOrder( Order.desc(\"age\") )\n"" .setMaxResults(50)\n"" .list();]]>"msgstr ""#. Tag: programlisting#: query_criteria.xml:100#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Property.forName(\"name\").like(\"F%\") )\n"" .addOrder( Property.forName(\"name\").asc() )\n"" .addOrder( Property.forName(\"age\").desc() )\n"" .setMaxResults(50)\n"" .list();]]>"msgstr ""#. Tag: title#: query_criteria.xml:105#, no-c-formatmsgid "Associations"msgstr "Associations"#. Tag: para#: query_criteria.xml:107#, no-c-formatmsgid """You may easily specify constraints upon related entities by navigating ""associations using <literal>createCriteria()</literal>."msgstr """Vous pouvez facilement spécifier des contraintes sur des entités liées, par ""des associations en utilisant <literal>createCriteria()</literal>."#. Tag: programlisting#: query_criteria.xml:112#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.like(\"name\", \"F%\") )\n"" .createCriteria(\"kittens\")\n"" .add( Restrictions.like(\"name\", \"F%\") )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:114#, no-c-formatmsgid """note that the second <literal>createCriteria()</literal> returns a new ""instance of <literal>Criteria</literal>, which refers to the elements of the ""<literal>kittens</literal> collection."msgstr """Notez que la seconde <literal>createCriteria()</literal> retourne une ""nouvelle instance de <literal>Criteria</literal>, qui se rapporte aux ""éléments de la collection <literal>kittens</literal>."#. Tag: para#: query_criteria.xml:120#, no-c-formatmsgid "The following, alternate form is useful in certain circumstances."msgstr "La forme alternative suivante est utile dans certains cas."#. Tag: programlisting#: query_criteria.xml:124#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .createAlias(\"kittens\", \"kt\")\n"" .createAlias(\"mate\", \"mt\")\n"" .add( Restrictions.eqProperty(\"kt.name\", \"mt.name\") )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:126#, no-c-formatmsgid """(<literal>createAlias()</literal> does not create a new instance of ""<literal>Criteria</literal>.)"msgstr """(<literal>createAlias()</literal> ne crée pas de nouvelle instance de ""<literal>Criteria</literal>.)"#. Tag: para#: query_criteria.xml:131#, no-c-formatmsgid """Note that the kittens collections held by the <literal>Cat</literal> ""instances returned by the previous two queries are <emphasis>not</emphasis> ""pre-filtered by the criteria! If you wish to retrieve just the kittens that ""match the criteria, you must use a <literal>ResultTransformer</literal>."msgstr """Notez que les collections kittens contenues dans les instances de ""<literal>Cat</literal> retournées par les deux précédentes requêtes ne sont ""<emphasis>pas</emphasis> pré-filtrées par les critères ! Si vous souhaitez ""récupérer uniquement les kittens qui correspondent à la criteria, vous devez ""utiliser <literal>ResultTransformer</literal>."#. Tag: programlisting#: query_criteria.xml:138#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .createCriteria(\"kittens\", \"kt\")\n"" .add( Restrictions.eq(\"name\", \"F%\") )\n"" .setResultTransformer(Criteria.ALIAS_TO_ENTITY_MAP)\n"" .list();\n""Iterator iter = cats.iterator();\n""while ( iter.hasNext() ) {\n"" Map map = (Map) iter.next();\n"" Cat cat = (Cat) map.get(Criteria.ROOT_ALIAS);\n"" Cat kitten = (Cat) map.get(\"kt\");\n""}]]>"msgstr ""#. Tag: title#: query_criteria.xml:143#, no-c-formatmsgid "Dynamic association fetching"msgstr "Peuplement d'associations de manière dynamique"#. Tag: para#: query_criteria.xml:145#, no-c-formatmsgid """You may specify association fetching semantics at runtime using ""<literal>setFetchMode()</literal>."msgstr """Vous pouvez spéficier au moment de l'exécution le peuplement d'une ""association en utilisant <literal>setFetchMode()</literal> (c'est-à-dire le ""chargement de celle-ci). Cela permet de surcharger les valeurs \"lazy\" et ""\"outer-join\" du mapping."#. Tag: programlisting#: query_criteria.xml:150#, no-c-formatmsgid """<![CDATA[List cats = sess.createCriteria(Cat.class)\n"" .add( Restrictions.like(\"name\", \"Fritz%\") )\n"" .setFetchMode(\"mate\", FetchMode.EAGER)\n"" .setFetchMode(\"kittens\", FetchMode.EAGER)\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:152#, no-c-formatmsgid """This query will fetch both <literal>mate</literal> and <literal>kittens</""literal> by outer join. See <xref linkend=\"performance-fetching\"/> for ""more information."msgstr """Cette requête recherchera <literal>mate</literal> et <literal>kittens</""literal> via les jointures externes. Voir <xref linkend=\"performance-""fetching\"/> pour plus d'informations."#. Tag: title#: query_criteria.xml:160#, no-c-formatmsgid "Example queries"msgstr "Requêtes par l'exemple"#. Tag: para#: query_criteria.xml:162#, no-c-formatmsgid """The class <literal>org.hibernate.criterion.Example</literal> allows you to ""construct a query criterion from a given instance."msgstr """La classe <literal>org.hibernate.criterion.Example</literal> vous permet de ""construire un critère suivant une instance d'objet donnée."#. Tag: programlisting#: query_criteria.xml:167#, no-c-formatmsgid """<![CDATA[Cat cat = new Cat();\n""cat.setSex('F');\n""cat.setColor(Color.BLACK);\n""List results = session.createCriteria(Cat.class)\n"" .add( Example.create(cat) )\n"" .list();]]>"msgstr ""#. Tag: para#: query_criteria.xml:169#, no-c-formatmsgid """Version properties, identifiers and associations are ignored. By default, ""null valued properties are excluded."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -