📄 ch06s03.html
字号:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JAWS Options</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html" title="Chapter 6. Customizing JAWS"><link rel="previous" href="ch06s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s02.html" title="Specifying a datasource"><link rel="next" href="ch06s04.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s04.html" title="Telling JAWS about your tables"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch06s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s02.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch06s04.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s04.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="jaws-options"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="jaws-options"></a>JAWS Options</h2></div></div><p>Here are the options you can set in JAWS. Default values are provided in the standardjaws.xml file:</p><div class="itemizedlist"><ul><li><p><a name="d0e2145"></a> create-table: this tells JAWS whether it has to try and create the
table for your beans at deployment time. It is turned on by
default. If the table already exists, JAWS will tell it to you, and
proceed.
</p></li><li><p><a name="d0e2148"></a> remove-table: this tells JAWS whether it has to remove (drop) the table
of your bean at undeployment time. It is turned off by
default. You may want to turn it on to clean the database. Note that if
you change a cmp-field in a bean, you will probably have to
drop the table and create it again, since the schema will have changed.
</p></li><li><p><a name="d0e2151"></a> tuned-updates: when this option is turned on (off by default) JAWS will only
update in the database the fields of your bean that have
actually changed.
</p></li><li><p><a name="d0e2154"></a> read-only: tells whether JAWS will allow client application to modify
the state of your beans. Default is false. If true, JAWS will
perform no INSERT/UPDATE.
</p></li><li><p><a name="d0e2157"></a> time-out: this option is only used when read-only is true. In this
case, JAWS will not refresh the state of your beans from the
database more than once every “time-out” milliseconds.
</p></li><li><p><a name="d0e2163"></a> select-for-update: when this option is turned on, JAWS will do a
SQL "SELECT ... FOR UPDATE" when an entity bean is loaded creating a row lock in the
datastore. This is very useful for synchronizing multiple instances of JBoss running
against the same datastore. The default value for select-for-update is false and
also false when the bean is read-only.
</p></li><li><p><a name="d0e2166"></a> debug: when this option is turned on (off by default), JAWS will log all SQL
queries at the debug level. This is useful when debugging CMP configuration and
database performance problems.
</p></li><li><p><a name="d0e2169"></a> pk-constraint: when this option is turned on (off by default) JAWS will create
an primary key constraint on the Primary Key fields : CREATE TABLE xxx (pk INTEGER,a VARCHAR(256),b VARCHAR(256),CONSTRAINT pkxxx PRIMARY KEY (pk)))
</p></li></ul></div><p>Each of these options can be set either generally (it will affect JAWS for your whole application)
or on a per bean basis, or both of these. JAWS will always read the defaults in standardjaws.xml first, then
override them with the defaults in jaws.xml if provided, and finally override them with bean-specific configuration
if provided.</p><p>General settings: to set an option generally, you have to declare it in a <default-entity> tag in jaws.xml. Here is the section as in standardjaws.xml, you may want to override all or part of it:
</p><pre class="programlisting">
<jaws>
<default-entity>
<create-table>true</create-table>
<remove-table>false</remove-table>
<tuned-updates>false</tuned-updates>
<read-only>false</read-only>
<time-out>300</time-out>
<select-for-update>false</select-for-update>
</default-entity>
...
<jaws>
</pre><p>Settings for a bean: to set an option for a particular bean, do it in the
corresponding <entity> section. For example, if you want JAWS to
drop the table for your ClassBean only, your xml file will contain:
</p><pre class="programlisting">
<jaws>
...
<enterprise-beans>
<entity>
<ejb-name>ClassBean</ejb-name>
<remove-table>true</remove-table>
</entity>
</enterprise-beans>
...
<jaws>
</pre><p>Note that the <ejb-name> tag must match the one declared in
ejb-jar.xml.
</p></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch06.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch06s02.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s02.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch06s04.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch06s04.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -