... when you
begin using Hibernate. Section 2. 3 covers the problem of configuring Hibernate
in some detail.
Transaction interface
The
Transaction
interface is an optional API. Hibernate applications ... <jose.romero@galicia.seresco.es>
integrating Hibernate
Introducing and
This chapter covers
■
Hibernate in action with “Hello World”
■
The Hibernate core programm...
... elements in our mapping files. This approach is time-consuming and easily
forgotten. Instead, we can implement Hibernate s
NamingStrategy
interface, as in
listing 3. 5
Listing 3. 5
NamingStrategy
... hibernate- mapping
B
DTD declaration
PUBLIC "-/ /Hibernate/ Hibernate Mapping DTD//EN"
"http:/ /hibernate. sourceforge.net /hibernate- mapping-2.0.dtd">...
... available in the package
net.sf .hibernate. mapping
. Keep in mind that adding a property to an existing
persistent class mapping as shown here is easy, but programmatically creating a
new mapping ... the distinction between entities and value types in
Hibernate. These concepts are required for fine-grained object modeling.
3.5 Fine-grained object models
A major objective of the...
...
Working with persistent objects
4.4.6 Selecting a fetching strategy in mappings
Hibernate lets you select default association fetching strategies by specifying
attributes in the mapping metadata. ...
you’re optimizing the default fetching strategies in your application.
A wrinkle in Hibernate s mapping format means that collection mappings func-
tion slightly differently than...
... achieved using shared read locks and exclusive
write locks. Reading transactions block writing transactions (but not other
reading transactions), and writing transactions block all other transactions. ...
the job of the Hibernate mapping types, and
string
is the name of a built -in Hiber-
nate mapping type.
The
string
mapping type isn’t the only one built into Hibernate; Hibernat...
... public static final Rating EXCELLENT = new Rating("Excellent");
public static final Rating OK = new Rating("OK");
public static final Rating LOW = new Rating("Low"); ... static final Map INSTANCES = new HashMap();
static {
INSTANCES.put(EXCELLENT.toString(), EXCELLENT);
INSTANCES.put(OK.toString(), OK);
INSTANCES.put(LOW.toString(), LOW);
}
private...
... expressing (inner and outer) joins:
■
An ordinary join in the
from
clause
■
A fetch join in the
from
clause
■
A theta-style join in the
where
clause
■
An implicit association join
Later, ...
candidates for a join
operation.
What most people think of when they hear the word join in the context of SQL
databases is an inner join. An inner join is one of several types o...
... <jose.romero@galicia.seresco.es>
346 CHAPTER 8
Writing Hibernate applications
It’s illegal to invoke the original Hibernate
Session
from an
Interceptor
call-
back. The session is in a fragile state during interceptor calls. ... try {
chain.doFilter(request, response);
// Commit any pending database transaction.
HibernateUtil.commitTransaction();
} finally {
// Disconne...
... processes
In some projects, the development of a domain model is driven by developers ana-
lyzing the business domain in object-oriented terms. In others, it’s heavily influ-
enced by an existing relational ... implement-
ing this interaction, many of which intruded on the implementation of the
domain model. Inheritance from generated source code, source code process-
ing, compiled byt...
... Subscribing to and
handling events 11 2
3.8 Summary 11 3
4
Exploring the Ajax server extensions 11 4
4 .1 Ajax for ASP.NET developers 11 5
What are the Ajax server extensions? 11 5
4.2 Enhancing an ... existing ASP.NET site 11 6
A sample ASP.NET site 11 7
■
Configuring an existing
ASP.NET site 11 8
4.3 ScriptManager: the brains of an Ajax page 12 0
Understanding...
... method.
ASP.NET AJAX in action 29
results. The delay in response time confuses the director and initially makes him
wonder if something is wrong with the application.
Before the introduction of Ajax, ... Microsoft Ajax Library extends
with methods commonly found in the .
NET
Array
class.
Listing 2. 6 Example using the Sys.StringBuilder class
Create instance of
StringBui...
... lan-
guages: inheritance.
Listing 3. 6 Declaring a class in a namespace
Classes in JavaScript 89
backslashes, it would be interpreted as a simple string instead of a date. This makes
JSON strings fully ... values in hexadecimal format and create bit-field flags. Let’s start with the pat-
tern for creating a
Size
enumeration, shown in listing 3. 13.
Listing 3. 12 Implementing t...
... service. Listing 5.17
contains the implementation for the provider class.
using System;
using System.Web;
using System.Net;
using System.Xml;
using System.Globalization;
namespace AspNetAjaxInAction
{
... session expires. Adding properties to a user profile is as easy as
updating web.config with a few extra lines, as shown in listing 5. 24.
Listing 5.23 Structure of the login method in...