![Red Hat Application Server Скачать руководство пользователя страница 101](http://html.mh-extra.com/html/red-hat/application-server/application-server_manual_1427406101.webp)
Chapter 8. Developing Entity Beans
93
:
/jdbc-mapping
;
:
cleanup
;
create
:
/cleanup
;
For an explicit mapping definition, refer to Section 8.11
JOnAS Database Mapping (Specific Deploy-
ment Descriptor)
.
For a CMP 2.0 Entity Bean, the JOnAS-specific deployment descriptor contains an additional element,
cleanup
, at the same level as the
jdbc-mapping
element, which can have one of the following
values:
removedata
At bean loading time, the content of the tables storing the bean data is deleted.
removeall
At bean loading time, the tables storing the bean data are dropped (if they exist) and created.
none
Do nothing.
create
Default value (if the element is not specified), at bean loading time, the tables for storing the bean
data are created if they do not exist.
For CMP 1.1, the
jdbc-mapping
element can also contain information defining the behavior
of the implementation of a
find
:
method
;
method (that is, the
ejbFind
:
method
;
method, that will be generated by the platform tools). This information is represented by the
finder-method-jdbc-mapping
element.
For each finder method, this element provides a way to define an SQL
WHERE
clause that will be used
in the generated finder method implementation to query the relational table storing the bean entities.
Note that the table column names should be used, not the bean field names. Example:
:
finder-method-jdbc-mapping
;
:
jonas-method
;
:
method-name
;
findLargeAccounts
:
/method-name
;
:
/jonas-method
;
:
jdbc-where-clause
;
where balance
;
?
:
/jdbc-where-clause
;
:
/finder-method-jdbc-mapping
;
The previous finder method description will cause the platform tools to generate an implementation
of ejbFindLargeAccount(double arg) that returns the primary keys of the Entity Bean objects corre-
sponding to the tuples returned by the
select ... from Account where balance
;
?
, where
’?’ will be replaced by the value of the first argument of the findLargeAccount method. If several ’?’
characters appear in the provided
WHERE
clause, this means that the finder method has several argu-
ments and the ’?’ characters will correspond to these arguments, adhering to the order of the method
signature.
In the
WHERE
clause, the parameters can be followed by a number, which specifies the method param-
eter number that will be used by the query in this position.
Example: The WHERE clause of the following finder method can be:
Enumeration findByTextAndDateCondition(String text, java.sql.Date date)
WHERE (description like ?1 OR summary like ?1) AND (?2
;
date)
Содержание Application Server
Страница 1: ...Red Hat Application Server JOnAS User Guide ...
Страница 8: ......
Страница 22: ...14 Chapter 1 Java Open Application Server JOnAS a J2EE Platform ...
Страница 58: ...50 Chapter 3 JOnAS Configuration ...
Страница 66: ...58 Chapter 5 JOnAS Class Loader Hierarchy ...
Страница 78: ...70 Chapter 6 JOnAS Command Reference ...
Страница 80: ......
Страница 86: ...78 Chapter 7 Developing Session Beans ...
Страница 136: ...128 Chapter 9 Developing Message Driven Beans ...
Страница 142: ...134 Chapter 10 Defining the Deployment Descriptor ...
Страница 148: ...140 Chapter 11 Transactional Behavior of EJB Applications ...
Страница 158: ...150 Chapter 14 EJB Packaging ...
Страница 162: ...154 Chapter 15 Application Deployment and Installation Guide ...
Страница 164: ......
Страница 176: ...168 Chapter 18 WAR Packaging ...
Страница 178: ......
Страница 184: ...176 Chapter 20 Defining the Client Deployment Descriptor ...
Страница 186: ...178 Chapter 21 Client Packaging ...
Страница 188: ......
Страница 192: ...184 Chapter 23 EAR Packaging ...
Страница 194: ......
Страница 200: ...192 Chapter 24 JOnAS Services ...
Страница 204: ...196 Chapter 25 JOnAS and the Connector Architecture ...
Страница 222: ...214 Chapter 27 Ant EJB Tasks Using EJB JAR ...
Страница 234: ...226 Chapter 29 Web Services with JOnAS ...
Страница 236: ......
Страница 260: ...252 Chapter 34 How to use Axis in JOnAS ...
Страница 270: ...262 Chapter 36 Web Service Interoperability between JOnAS and BEA WebLogic ...
Страница 296: ......