alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Hibernate example source code file (query_criteria.pot)

This example Hibernate source code file (query_criteria.pot) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Hibernate tags/keywords

a, an, by, queries, sql, tag, tag, the, the, there, this, this, you, you

The Hibernate query_criteria.pot source code

# 
# AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
"POT-Creation-Date: 2010-02-11T05:38:15\n"
"PO-Revision-Date: 2010-02-11T05:38:15\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. Tag: title
#, no-c-format
msgid "Criteria Queries"
msgstr ""

#. Tag: para
#, no-c-format
msgid "Hibernate features an intuitive, extensible criteria query API."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Creating a <literal>Criteria instance"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The interface <literal>org.hibernate.Criteria represents a query against a particular persistent class. The Session is a factory for Criteria instances."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Narrowing the result set"
msgstr ""

#. Tag: para
#, no-c-format
msgid "An individual query criterion is an instance of the interface <literal>org.hibernate.criterion.Criterion. The class org.hibernate.criterion.Restrictions defines factory methods for obtaining certain built-in Criterion types."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Restrictions can be grouped logically."
msgstr ""

#. Tag: para
#, no-c-format
msgid "There are a range of built-in criterion types (<literal>Restrictions subclasses). One of the most useful allows you to specify SQL directly."
msgstr ""

#. Tag: para
#, no-c-format
msgid "The <literal>{alias} placeholder with be replaced by the row alias of the queried entity."
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can also obtain a criterion from a <literal>Property instance. You can create a Property by calling Property.forName():"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Ordering the results"
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can order the results using <literal>org.hibernate.criterion.Order."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Associations"
msgstr ""

#. Tag: para
#, no-c-format
msgid "By navigating associations using <literal>createCriteria() you can specify constraints upon related entities:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The second <literal>createCriteria() returns a new instance of Criteria that refers to the elements of the kittens collection."
msgstr ""

#. Tag: para
#, no-c-format
msgid "There is also an alternate form that is useful in certain circumstances:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "(<literal>createAlias() does not create a new instance of Criteria.)"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The kittens collections held by the <literal>Cat instances returned by the previous two queries are not pre-filtered by the criteria. If you want to retrieve just the kittens that match the criteria, you must use a ResultTransformer."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Additionally you may manipulate the result set using a left outer join:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "This will return all of the <literal>Cats with a mate whose name starts with \"good\" ordered by their mate's age, and all cats who do not have a mate. This is useful when there is a need to order or limit in the database prior to returning complex/large result sets, and removes many instances where multiple queries would have to be performed and the results unioned by java in memory."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Without this feature, first all of the cats without a mate would need to be loaded in one query."
msgstr ""

#. Tag: para
#, no-c-format
msgid "A second query would need to retreive the cats with mates who's name started with \"good\" sorted by the mates age."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Thirdly, in memory; the lists would need to be joined manually."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Dynamic association fetching"
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can specify association fetching semantics at runtime using <literal>setFetchMode()."
msgstr ""

#. Tag: para
#, no-c-format
msgid "This query will fetch both <literal>mate and kittens by outer join. See  for more information."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Example queries"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The class <literal>org.hibernate.criterion.Example allows you to construct a query criterion from a given instance."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Version properties, identifiers and associations are ignored. By default, null valued properties are excluded."
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can adjust how the <literal>Example is applied."
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can even use examples to place criteria upon associated objects."
msgstr ""

#. Tag: title
#, no-c-format
msgid "Projections, aggregation and grouping"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The class <literal>org.hibernate.criterion.Projections is a factory for Projection instances. You can apply a projection to a query by calling setProjection()."
msgstr ""

#. Tag: para
#, no-c-format
msgid "There is no explicit \"group by\" necessary in a criteria query. Certain projection types are defined to be <emphasis>grouping projections, which also appear in the SQL group by clause."
msgstr ""

#. Tag: para
#, no-c-format
msgid "An alias can be assigned to a projection so that the projected value can be referred to in restrictions or orderings. Here are two different ways to do this:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The <literal>alias() and as() methods simply wrap a projection instance in another, aliased, instance of Projection. As a shortcut, you can assign an alias when you add the projection to a projection list:"
msgstr ""

#. Tag: para
#, no-c-format
msgid "You can also use <literal>Property.forName() to express projections:"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Detached queries and subqueries"
msgstr ""

#. Tag: para
#, no-c-format
msgid "The <literal>DetachedCriteria class allows you to create a query outside the scope of a session and then execute it using an arbitrary Session."
msgstr ""

#. Tag: para
#, no-c-format
msgid "A <literal>DetachedCriteria can also be used to express a subquery. Criterion instances involving subqueries can be obtained via Subqueries or Property."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Correlated subqueries are also possible:"
msgstr ""

#. Tag: title
#, no-c-format
msgid "Queries by natural identifier"
msgstr ""

#. Tag: para
#, no-c-format
msgid "For most queries, including criteria queries, the query cache is not efficient because query cache invalidation occurs too frequently. However, there is a special kind of query where you can optimize the cache invalidation algorithm: lookups by a constant natural key. In some applications, this kind of query occurs frequently. The criteria API provides special provision for this use case."
msgstr ""

#. Tag: para
#, no-c-format
msgid "First, map the natural key of your entity using <literal><natural-id> and enable use of the second-level cache."
msgstr ""

#. Tag: para
#, no-c-format
msgid "This functionality is not intended for use with entities with <emphasis>mutable natural keys."
msgstr ""

#. Tag: para
#, no-c-format
msgid "Once you have enabled the Hibernate query cache, the <literal>Restrictions.naturalId() allows you to make use of the more efficient cache algorithm."
msgstr ""

Other Hibernate examples (source code examples)

Here is a short list of links related to this Hibernate query_criteria.pot source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.