提交 b04bfcec authored 作者: Thomas Mueller's avatar Thomas Mueller

Documentation.

上级 81374dd5
......@@ -441,6 +441,8 @@ Creates a new data type (domain). The check condition must evaluate to true or
to NULL (to prevent NULL, use NOT NULL). In the condition, the term VALUE refers
to the value being tested.
Domains are usable within the whole database. They can not be created in a specific schema.
This command commits an open transaction.
","
CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION('@', VALUE) > 1)
......@@ -607,12 +609,17 @@ CREATE USER GUEST PASSWORD 'abc'
"
"Commands (DDL)","CREATE VIEW","
CREATE [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
CREATE [ OR REPLACE ] [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
[ ( columnName [,...] ) ] AS select
","
Creates a new view. If the force option is used, then the view is created even
if the underlying table(s) don't exist.
If the OR REPLACE clause is used an existing view will be replaced, and any
dependent views will not need to be recreated. If dependent views will become
invalid as a result of the change an error will be generated, but this error
can be ignored if the FORCE clause is also used.
Admin rights are required to execute this command.
This command commits an open transaction.
","
......@@ -741,11 +748,11 @@ DROP USER TOM
"
"Commands (DDL)","DROP VIEW","
DROP VIEW [ IF EXISTS ] viewName
DROP VIEW [ IF EXISTS ] viewName [RESTRICT | CASCADE ]
","
Drops a view.
Drops a view, and all dependent views if the CASCADE clause is used.
The command will fail if dependent views exist and the RESTRICT clause is used. This is the default.
This command commits an open transaction.
This will also drop all views that depend on this view.
","
DROP VIEW TEST_VIEW
"
......
......@@ -18,7 +18,8 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>Experimental feature to support case sensitive catalog names
<ul><li>Build tool: ability to only run one test using the -Dtest=className setting.
</li><li>Experimental feature to support case sensitive catalog names
and database names using the DATABASE() method.
To use this feature, set the system property h2.databaseToUpper to false.
The plan is to set the property to false by default in version 1.3.x.
......
......@@ -446,7 +446,7 @@ all clients that want to connect to the database (no matter if
it's an local or remote connection) can do so using the exact same database URL.
</p>
<img src="images/connection-mode-mixed.png"
alt="The database and the server is running inside the application; another application connects remotely" />
alt="Database, server, and application run in one JVM; an application connects" />
<h2 id="database_url">Database URL Overview</h2>
<p>
......
......@@ -15,7 +15,7 @@ Initial Developer: H2 Group
<table class="nav" onmousemove="return mouseMove(event)"><tr class="nav"><td class="nav" valign="top">
<div id = "searchMenu" style="width: 180px; overflow: hidden;">
<div class="menu">
<img src="images/h2-logo.png" alt="H2 Logo" onclick="document.location='main.html'" width="136" height="74"/>
<img src="images/h2-logo.png" alt="H2 database logo" onclick="document.location='main.html'" width="136" height="74"/>
</div>
<form action="submit" onsubmit="return goFirst();">
......@@ -31,7 +31,7 @@ translate -->
</tr>
<tr class="search">
<td class="search" colspan="2">
<b>Search:</b>
<b><label for="search">Search:</label></b>
</td>
</tr>
<tr class="search">
......@@ -41,8 +41,12 @@ translate -->
</td>
</tr>
<tr class="search" style="display:none;" >
<td class="search" style="width: 1%; vertical-align: middle;"><input id = "highlight" type="checkbox" checked="checked" onclick="highlightCurrent(this.checked, search.value)" /></td>
<td class="search" style="width: 99%; padding: 0px; vertical-align: middle;">Highlight keyword(s)</td>
<td class="search" style="width: 1%; vertical-align: middle;">
<input id = "highlight" type="checkbox" checked="checked" onclick="highlightCurrent(this.checked, search.value)" />
</td>
<td class="search" style="width: 99%; padding: 0px; vertical-align: middle;">
<label for="highlight">Highlight keyword(s)</label>
</td>
</tr>
<tr class="search">
<td class="search" colspan="2">
......@@ -71,7 +75,7 @@ translate -->
<a href="functions.html">Functions</a><br />
<a href="datatypes.html">Data Types</a><br />
<a href="../javadoc/index.html">Javadoc</a><br />
<a href="../h2.pdf">PDF (1 MB)</a><br />
<a href="../h2.pdf" onclick="return openInNewWindow(this)">PDF (1 MB)</a><br />
<br />
<b>Support</b><br />
<a href="faq.html">FAQ</a><br />
......
......@@ -6,7 +6,9 @@ and under the Eclipse Public License, Version 1.0
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="description" content="H2 is free SQL database written in Java"/>
<title>
H2 Database Engine
</title><link rel="stylesheet" type="text/css" href="stylesheet.css" />
<!-- [search] { -->
......
......@@ -6,7 +6,9 @@ and under the Eclipse Public License, Version 1.0
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="description" content="H2 is free SQL database written in Java"/>
<title>
H2 Database Engine
</title><link rel="stylesheet" type="text/css" href="stylesheet.css" />
<link rel="alternate" type="application/atom+xml" title="H2 Newsfeed (Atom)" href="http://www.h2database.com/html/newsfeed-atom.xml" />
......@@ -32,16 +34,16 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 12px 7px;">
<tr><td style="border: 0px; background-color: #eee;" colspan="2">
<h3 style="margin-top: 1em;">Download</h3>
<h2 style="margin-top: 1em;">Download</h2>
Version ${version} (${versionDate}):
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-${versionDate}.exe"><img style="border: 1px #00f solid;" src="images/download.png" alt="download" width="22" height="20"/></a>
<a href="http://www.h2database.com/h2-setup-${versionDate}.exe"><img style="border: 1px #00f solid;" src="images/download.png" alt="Download this database" width="22" height="20"/></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-setup-${versionDate}.exe">Windows Installer (4 MB)</a>
</td></tr>
<tr><td style="border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-${versionDate}.zip"><img style="border: 1px #00f solid;" src="images/download.png" alt="download" width="22" height="20"/></a>
<a href="http://www.h2database.com/h2-${versionDate}.zip"><img style="border: 1px #00f solid;" src="images/download.png" alt="Download this database" width="22" height="20"/></a>
</td><td style="vertical-align: middle; border: 0px; background-color: #eee;">
<a href="http://www.h2database.com/h2-${versionDate}.zip">All Platforms (zip, 5 MB)</a>
</td></tr>
......@@ -54,7 +56,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<td style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 12px 7px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3 style="margin-top: 1em;">Support</h3>
<h2 style="margin-top: 1em;">Support</h2>
<p>
<a href="http://groups.google.com/group/h2-database">English Google Group</a><br />
<a href="http://groups.google.co.jp/group/h2-database-jp">Japanese Google Group</a><br /><br />
......@@ -78,7 +80,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
</td></tr>
<tr><td colspan="3" style="border: 0px; padding: 5px 0px 15px 0px;">
<h3 style="margin-top: 1em;">Features</h3>
<h2 style="margin-top: 1em;">Features</h2>
<table style="width: 425px;"><tr class="notranslate">
<th></th>
<th>H2</th>
......@@ -159,7 +161,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td colspan="3" style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 0px 7px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3 style="margin-top: 1em;">News</h3>
<h2 style="margin-top: 1em;">News</h2>
<p>
<b>Newsfeeds:</b>
<a href="http://www.h2database.com/html/newsfeed-atom.xml">Full text (Atom)</a>
......@@ -180,7 +182,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<tr><td colspan="3" style="border: 0px; background-color: #eee;">
<table style="border: 0px; margin: 0px 7px 5px 7px;">
<tr><td style="border: 0px; background-color: #eee;">
<h3 style="margin-top: 1em;">Contribute</h3>
<h2 style="margin-top: 1em;">Contribute</h2>
<p>
You can contribute to the development of H2 by sending feedback and bug
reports, or translate the H2 Console application (for details, start the H2 Console
......@@ -190,8 +192,7 @@ Welcome to H2, the Java SQL database. The main features of H2 are:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<p>
<input type="hidden" name="cmd" value="_s-xclick"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" name="submit" alt="PayPal"/>
<img alt="" src="https://www.paypal.com/de_DE/i/scr/pixel.gif" width="1" height="1" />
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" name="submit" alt="PayPal icon"/>
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----"/>
</p>
</form>
......
......@@ -5,6 +5,12 @@
* Initial Developer: H2 Group
*/
function openInNewWindow(t) {
var w = window.open(t.getAttribute('href'), '_blank');
w.focus();
return false;
}
function loadFrameset() {
var a = location.search.split('&');
var page = decodeURIComponent(a[0].substr(1));
......@@ -144,16 +150,19 @@ function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) {
var drag = false;
var dragSize = 0;
var dragStart = 0;
function mouseDown(e) {
dragStart = e.clientX || e.pageX;
dragSize = parseInt(document.getElementById('searchMenu').style.width);
drag = true;
return false;
}
function mouseUp(e) {
drag = false;
return false;
}
function mouseMove(e) {
if (drag) {
var e = e || window.event;
......
......@@ -81,7 +81,7 @@ Please note this is mostly a single connection benchmark run on one computer.
<tr><td>BenchC: Memory Usage</td><td>MB</td><td>12</td><td>21</td><td>14</td><td>2</td><td>2</td></tr>
<tr><td>Executed statements</td><td>#</td><td>322929</td><td>322929</td><td>322929</td><td>322929</td><td>322929</td></tr>
<tr><td>Total time</td><td>ms</td><td>32106</td><td>34546</td><td>74245</td><td>53791</td><td>53216</td></tr>
<tr><td>Statements per second</td><td>#</td><td>10058</td><td>9347</td><td>4349</td><td>6003</td><td>6068</td></tr></table>
<tr><td>Statements per second</td><td>#</td><td>10058</td><td>9347</td><td>4349</td><td>6003</td><td>6068</td></tr>
</table>
<h3>Benchmark Results and Comments</h3>
......@@ -115,7 +115,9 @@ This seems to be a structural problem, because all operations are really slow.
It will be hard for the developers of Derby to improve the performance to a reasonable level.
A few problems have been identified: leaving autocommit on is a problem for Derby.
If it is switched off during the whole test, the results are about 20% better for Derby.
Derby does not call <code>FileDescriptor.sync() / FileChannel.force(..)</code> on each commit.
Derby calls <code>FileChannel.force(false)</code>, but only twice per log file (not on each commit).
Disabling this call improves performance for Derby by about 2%.
Unlike H2, Derby does not call <code>FileDescriptor.sync()</code> on each checkpoint.
Derby supports a testing mode (system property <code>derby.system.durability=test</code>)
where durability is disabled. According to the documentation, this setting should be used for testing only,
as the database may not recover after a crash. Enabling this setting improves performance
......@@ -203,7 +205,7 @@ For the Java databases, both embedded and server modes are tested.
<h4>Test Platform</h4>
<p>
This test is run on Mac OS X 10.6. No virus scanner was used, and disk indexing was turned off.
This test is run on Mac OS X 10.6. No virus scanner was used, and disk indexing was disabled.
The VM used is Sun JDK 1.6.
</p>
......
......@@ -52,9 +52,9 @@ Install the software using the Windows Installer (if you did not yet do that).
<h4>Start the Console</h4>
<p>
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br />
<img class="screenshot" src="images/quickstart-1.png" alt="screenshot: start H2 Console" /><br />
<img class="screenshot" src="images/quickstart-1.png" alt="Screenshot: start H2 Console" /><br />
A new console window appears:<br />
<img class="screenshot" src="images/quickstart-2.png" alt="screenshot: H2 running" /><br />
<img class="screenshot" src="images/quickstart-2.png" alt="Screenshot: H2 running" /><br />
Also, a new browser page should open with the URL <a href="http://localhost:8082" class="notranslate">http://localhost:8082</a>.
You may get a security warning from the firewall. If you don't want other computers in the network to access the database
on your machine, you can let the firewall block these connections. Only local connections are required at this time.
......@@ -63,24 +63,24 @@ on your machine, you can let the firewall block these connections. Only local co
<h4>Login</h4>
<p>
Select [Generic H2] and click [Connect]:<br />
<img class="screenshot" src="images/quickstart-3.png" alt="screenshot: login" /><br />
<img class="screenshot" src="images/quickstart-3.png" alt="Screenshot: login" /><br />
You are now logged in.
</p>
<h4>Sample</h4>
<p>
Click on the [Sample SQL Script]:<br />
<img class="screenshot" src="images/quickstart-4.png" alt="screenshot: click on the sample SQL script" /><br />
<img class="screenshot" src="images/quickstart-4.png" alt="Screenshot: click on the sample SQL script" /><br />
The SQL commands appear in the command area.<br />
</p>
<h4>Execute</h4>
<p>
Click [Run]<br />
<img class="screenshot" src="images/quickstart-5.png" alt="screenshot: click Run" /><br />
<img class="screenshot" src="images/quickstart-5.png" alt="Screenshot: click Run" /><br />
On the left side, a new entry TEST is added below the database icon.
The operations and results of the statements are shown below the script.<br />
<img class="screenshot" src="images/quickstart-6.png" alt="screenshot: see the result" /><br />
<img class="screenshot" src="images/quickstart-6.png" alt="Screenshot: see the result" /><br />
</p>
<h4>Disconnect</h4>
......
......@@ -34,6 +34,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
(also remove Constants.UNDO_BLOCK_SIZE).
Later, change undo log file format (fillAligned no longer required; var int).
</li><li>Enable h2.nestedJoins (nested joins and right outer joins).
</li><li>Enable h2.optimizeOr (convert OR conditions to IN(..) if possible).
</li><li>Disable h2.databaseToUpper (database short names are converted to uppercase).
</li></ul>
......@@ -45,8 +46,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li></ul>
<h2>Priority 2</h2>
<ul><li>Support nested outer joins (see todo.txt, issues 145, 177, 203).
</li><li>Improve test code coverage.
<ul><li>Improve test code coverage.
</li><li>Test multi-threaded in-memory db access.
</li><li>Access rights: remember the owner of an object. Create, alter and drop privileges. COMMENT: allow owner of object to change it. Issue 208
</li><li>Full outer joins.
......@@ -499,6 +499,8 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>Improve object memory size calculation. Use constants for known VMs, or use reflection to call java.lang.instrument.Instrumentation.getObjectSize(Object objectToSize)
</li><li>Triggers: NOT NULL checks should be done after running triggers (Oracle behavior, maybe others).
</li><li>Log long running transactions (similar to long running statements).
</li><li>Support schema specific domains.
</li><li>Some combinations of nested join with right outer join are not supported.
</li></ul>
<h2>Not Planned</h2>
......
......@@ -109,6 +109,10 @@ a {
color: #0000ff;
}
a:visited {
color: #0000bb;
}
a:hover {
text-decoration: underline;
}
......
......@@ -78,7 +78,7 @@ Depending on your platform and environment, there are multiple ways to start the
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]<br />
When using the Sun JDK 1.5, a window with the title 'H2 Console ' should appear.
When using the Sun JDK 1.6, an icon will be added to the system tray:
<img src="images/db-16.png" alt="[H2 icon]" /><br />
<img src="images/db-16.png" alt="H2 database icon" /><br />
If you don't get the window and the system tray icon,
then maybe Java is not installed correctly (in this case, try another way to start the application).
A browser window should open and point to the Login page at <code>http://localhost:8082</code>.
......
......@@ -6,8 +6,10 @@ and under the Eclipse Public License, Version 1.0
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
H2 Database Engine
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="description" content="H2 is free SQL database written in Java"/>
<title>
H2 Database Engine (redirect)
</title><link rel="stylesheet" type="text/css" href="html/stylesheet.css" />
<script type="text/javascript">
location.href = 'html/main.html';
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -199,7 +199,7 @@ CREATE USER [ IF NOT EXISTS ] newUserName
","
Creates a new user."
"Commands (DDL)","CREATE VIEW","
CREATE [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
CREATE [ OR REPLACE ] [ FORCE ] VIEW [ IF NOT EXISTS ] newViewName
[ ( columnName [,...] ) ] AS select
","
Creates a new view."
......@@ -253,9 +253,9 @@ DROP USER [ IF EXISTS ] userName
","
Drops a user."
"Commands (DDL)","DROP VIEW","
DROP VIEW [ IF EXISTS ] viewName
DROP VIEW [ IF EXISTS ] viewName [RESTRICT | CASCADE ]
","
Drops a view."
Drops a view, and all dependent views if the CASCADE clause is used."
"Commands (DDL)","TRUNCATE TABLE","
TRUNCATE TABLE tableName
","
......@@ -1122,7 +1122,7 @@ Adds units to a timestamp."
"Functions (Time and Date)","DATEDIFF","
{ DATEDIFF | TIMESTAMPDIFF } (unitString, aTimestamp, bTimestamp)
","
Returns the difference between two timestamps."
Returns the the number of crossed unit boundaries between two timestamps."
"Functions (Time and Date)","DAYNAME","
DAYNAME(date)
","
......
Nested Outer Joins
TIMESTAMPDIFF
-----------------
Example:
Test cases:
select timestampdiff(year, '2000-01-01', '2001-01-01');
select timestampdiff(year, '2000-03-01', '2001-03-01');
select timestampdiff(day, '2000-03-01', '2001-03-01');
select timestampdiff(year, '2000-02-29', '2001-02-28');
select timestampdiff(day, '2000-02-29', '2001-02-28');
select timestampdiff(month, '2000-02-29', '2001-02-28');
select timestampadd(year, 1, '2000-02-29');
create table a(x int);
create table b(x int);
create table c(x int, y int);
insert into a values(1);
insert into a values(2);
insert into b values(3);
insert into c values(1, 3);
insert into c values(4, 5);
select * from a left outer join (b left outer join c on b.x = c.y) on a.x = c.x;
explain select * from a left outer join (b left outer join c on b.x = c.y) on a.x = c.x;
drop table a;
drop table b;
drop table c;
The following doesn't work correctly:
TableFilter,
private void mapAndAddFilter(Expression on) throws SQLException {
on.mapColumns(this, 0);
if (join == null || on.isEverything(ExpressionVisitor.RESOLVED)) {
addFilterCondition(on, true);
on.createIndexConditions(session, this);
}
if (join != null) {
join.mapAndAddFilter(on);
}
}
drop table base;
drop table a;
drop table b;
create table a( pk integer, val varchar(255) );
create table b( pk integer, val varchar(255) );
create table base( pk integer, deleted integer );
insert into base values ( 1, 0 );
insert into base values ( 2, 1 );
insert into base values ( 3, 0 );
insert into a values ( 1, 'a' );
insert into b values ( 2, 'a' );
insert into b values ( 3, 'a' );
select a.pk, a_base.pk, b.pk, b_base.pk from a inner join base a_base
on a.pk = a_base.pk left outer join
( b inner join base b_base on b.pk = b_base.pk and b_base.deleted = 0 ) ;
-- H2:
-- 1 1 2 null
-- 1 1 3 3
-- PostgreSQL: ERROR: syntax error at end of input 42601/0
-- MySQL: You have an error in your SQL syntax;
-- check the manual that corresponds to your MySQL server version
-- for the right syntax to use near '' at line 3
-- Derby: Syntax error: Encountered "<EOF>" at line 3, column 71. 42X01/30000
-- HSQLDB: Unexpected token B, requires SELECT in statement
select a.pk, a_base.pk, b.pk, b_base.pk from a inner join base a_base
on a.pk = a_base.pk left outer join
( b inner join base b_base on b.pk = b_base.pk and b_base.deleted = 0 )
on a.pk = b.pk;
-- H2, MySQL, PostgreSQL, Derby:
-- 1 1 null null
-- HSQLDB: Unexpected token B, requires SELECT in statement
select a.pk, a_base.pk, b.pk, b_base.pk from a inner join base a_base
on a.pk = a_base.pk left outer join
( b inner join base b_base on b.pk = b_base.pk and b_base.deleted = 0 )
on 1=1;
-- H2:
-- 1 1 2 null
-- 1 1 3 3
-- PostgreSQL, MySQL, Derby:
-- 1 1 3 3
-- HSQLDB: Unexpected token B, requires SELECT in statement
select a.pk, a_base.pk, b_pk, b_base_pk from a inner join base a_base
on a.pk = a_base.pk left outer join
( select b.pk b_pk, b_base.pk b_base_pk from b inner join base b_base on b.pk = b_base.pk and b_base.deleted = 0 ) x
on 1=1;
-- PostgreSQL, MySQL, Derby, H2:
-- 1 1 3 3
Auto Upgrade
-----------------
......
......@@ -646,4 +646,5 @@ darri chunks bjorn chunked watson regardless usefulinc represented pushd
recorder grajciar recording slovensky uninitialized arriving lubomir unchanged
erik dick calculations lutin cite bom evaluating telegard excel bbs deprecation
importing cumulative fired convenient sums judged anybody vacuum encountered
corresponds
corresponds cnf informatique ilm boundaries shao crossed retroweaver usr pico
pengxiang china
......@@ -249,7 +249,8 @@ public class PrepareTranslation {
} else if ("p".equals(tag) || "li".equals(tag) || "a".equals(tag) || "td".equals(tag)
|| "th".equals(tag) || "h1".equals(tag) || "h2".equals(tag) || "h3".equals(tag)
|| "h4".equals(tag) || "body".equals(tag) || "b".equals(tag) || "code".equals(tag)
|| "form".equals(tag) || "span".equals(tag) || "em".equals(tag) || "div".equals(tag)) {
|| "form".equals(tag) || "span".equals(tag) || "em".equals(tag) || "div".equals(tag)
|| "label".equals(tag)) {
if (buff.length() == 0) {
nextKey = documentName + "_" + (1000 + id++) + "_" + tag;
template.append(getSpace(s, true));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论