📄 viewcreation.java
字号:
/*
* ViewCreation.java
*
* Created on 2007年5月11日, 上午1:03
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package XRSystem.Process;
/**
*
* @author 王刚
*/
import java.lang.*;
import java.util.*;
import XRSystem.DataAccess.SQLResultSet;
public class ViewCreation {
private String FileName;
/** Creates a new instance of ViewCreation */
public ViewCreation(String FileName) {
this.FileName = FileName;
}
public void CreateView()
{
String SQLString = "CREATE VIEW ["+FileName+"] "+
" AS "+
" SELECT ElementStructure.*,[Text].TextContent AS 子元素文本,Attribute.AttributeName AS 属性名,Attribute.AttributeValue AS 属性值 "+
" FROM "+
" (SELECT ParentElement.DocumentID AS 文档编号, "+
" ParentElement.ElementPre AS 父元素Pre, "+
" ParentElement.ElementPost AS 父元素Post, "+
" ParentElement.ElementTag AS 父元素标记, "+
" ChildElement.ElementPre AS 子元素Pre, "+
" ChildElement.ElementPost AS 子元素Post, "+
" ChildElement.ElementTag AS 子元素标记 "+
" FROM Element ParentElement "+
" LEFT JOIN Element ChildElement ON ChildElement.ParentPre=ParentElement.ElementPre "+
"AND ChildElement.ParentPost=ParentElement.ElementPost) AS ElementStructure "+
" LEFT JOIN [Text] "+
" ON ElementStructure.子元素Pre=Text.ElementPre AND ElementStructure.子元素Post=Text.ElementPost "+
" LEFT JOIN Attribute "+
" ON ElementStructure.子元素Pre=Attribute.ElementPre AND ElementStructure.子元素Post=Attribute.ElementPost "+
" WHERE ElementStructure.文档编号=(SELECT DocumentID FROM Document WHERE DocumentName="+"'"+FileName+"')";
try {
new SQLResultSet().ExecuteInsert(SQLString);
} catch(Exception e){e.printStackTrace();}
}
public static void main(String[] args)
{
new ViewCreation("Issue.xml").CreateView();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -