Movatterモバイル変換


[0]ホーム

URL:


Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Pages Technology

6.  JavaServer Pages Documents

7.  JavaServer Pages Standard Tag Library

8.  Custom Tags in JSP Pages

9.  Scripting in JSP Pages

10.  JavaServer Faces Technology

11.  Using JavaServer Faces Technology in JSP Pages

12.  Developing with JavaServer Faces Technology

13.  Creating Custom UI Components

14.  Configuring JavaServer Faces Applications

15.  Internationalizing and Localizing Web Applications

Part III Web Services

16.  Building Web Services with JAX-WS

17.  Binding between XML Schema and Java Classes

18.  Streaming API for XML

19.  SOAP with Attachments API for Java

Part IV Enterprise Beans

20.  Enterprise Beans

21.  Getting Started with Enterprise Beans

22.  Session Bean Examples

23.  A Message-Driven Bean Example

Part V Persistence

24.  Introduction to the Java Persistence API

25.  Persistence in the Web Tier

26.  Persistence in the EJB Tier

27.  The Java Persistence Query Language

Query Language Terminology

Simplified Query Language Syntax

Select Statements

Update and Delete Statements

Example Queries

Simple Queries

A Basic Select Query

Eliminating Duplicate Values

Using Named Parameters

Queries That Navigate to Related Entities

A Simple Query with Relationships

Navigating to Single-Valued Relationship Fields

Traversing Relationships with an Input Parameter

Traversing Multiple Relationships

Navigating According to Related Fields

Queries with Other Conditional Expressions

TheLIKE Expression

TheIS NULL Expression

TheIS EMPTY Expression

TheBETWEEN Expression

Comparison Operators

Bulk Updates and Deletes

Update Queries

Delete Queries

Full Query Language Syntax

BNF Symbols

BNF Grammar of the Java Persistence Query Language

FROM Clause

Identifiers

Identification Variables

Path Expressions

Examples of Path Expressions

Expression Types

Navigation

WHERE Clause

Literals

Input Parameters

Conditional Expressions

Operators and Their Precedence

BETWEEN Expressions

IN Expressions

LIKE Expressions

NULL Comparison Expressions

Empty Collection Comparison Expressions

Collection Member Expressions

Subqueries

Functional Expressions

NULL Values

Equality Semantics

SELECT Clause

Return Types

TheDISTINCT Keyword

Constructor Expressions

ORDER BY Clause

TheGROUP BY Clause

TheHAVING Clause

Part VI Services

28.  Introduction to Security in the Java EE Platform

29.  Securing Java EE Applications

30.  Securing Web Applications

31.  The Java Message Service API

32.  Java EE Examples Using the JMS API

33.  Transactions

34.  Resource Connections

35.  Connector Architecture

Part VII Case Studies

36.  The Coffee Break Application

37.  The Duke's Bank Application

Part VIII Appendixes

A.  Java Encoding Schemes

B.  About the Authors

Index

 

The Java EE 5 Tutorial

Java Coffee Cup logo
PreviousContentsNext

Simplified Query Language Syntax

This section briefly describes the syntax of the query language so that youcan quickly move on to the next section,Example Queries. When you areready to learn about the syntax in more detail, see the sectionFull Query Language Syntax.

Select Statements

A select query has six clauses:SELECT,FROM,WHERE,GROUP BY,HAVING, andORDER BY. TheSELECT andFROM clauses are required, but theWHERE,GROUP BY,HAVING,andORDER BY clauses are optional. Here is the high-level BNF syntax of aquery language query:

QL_statement ::= select_clause from_clause   [where_clause][groupby_clause][having_clause][orderby_clause]

TheSELECT clause defines the types of the objects or values returned bythe query.

TheFROM clause defines the scope of the query by declaring one ormore identification variables, which can be referenced in theSELECT andWHERE clauses. Anidentification variable represents one of the following elements:

  • The abstract schema name of an entity

  • An element of a collection relationship

  • An element of a single-valued relationship

  • A member of a collection that is the multiple side of a one-to-many relationship

TheWHERE clause is a conditional expression that restricts the objects or valuesretrieved by the query. Although it is optional, most queries have aWHEREclause.

TheGROUP BY clause groups query results according to a set of properties.

TheHAVING clause is used with theGROUP BY clause to further restrict thequery results according to a conditional expression.

TheORDER BY clause sorts the objects or values returned by the query intoa specified order.

Update and Delete Statements

Update and delete statements provide bulk operations over sets of entities. They havethe following syntax:

update_statement :: = update_clause [where_clause] delete_statement :: =         delete_clause [where_clause]

The update and delete clauses determine the type of the entities to beupdated or deleted. TheWHERE clause may be used to restrict the scopeof the update or delete operation.

PreviousContentsNext

Copyright © 2010, Oracle and/or its affiliates. All rights reserved.Legal Notices


[8]ページ先頭

©2009-2025 Movatter.jp