- 浏览: 200073 次
- 性别:
- 来自: 北京
-
最新评论
-
wentry:
java中字符带有斜杠时,比如\\x00\\x00\\x00\ ...
java中调用js脚本 -
chenzheng8975:
...
ajax -
蓝色飞扬:
有用,也碰到这个问题了,多谢!
java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion -
刘宇斌:
一篇不错的讲解Java异常的文章(转载)----感觉很不错,读了以后很有启发 -
moxiaomomo:
同样的疑问啊...对tomcat缓存仍然一知半解...
tomcat 缓存
文章列表
Table per Class Strategy: the <union-class> element in Hibernate Single Table per Class Hierarchy Strategy: the <subclass> element in Hibernate Joined Subclass Strategy: the <joined-subclass> element in Hibernate ejb支持三种映射关系1,每个类一张表 (hibertnate里对应<union-class>)2,每个类层次一张表 (在 hi ...
- 2009-08-19 10:31
- 浏览 1683
- 评论(0)
主键类:定义为@Embeddable
@Embeddablepublic class F {
private int id; private int id2; public int getId() { return id; } public void setId(int id) { this.id = id; } public int getId2() { return id2; } public void setId2(int id2) { this.id2 = id2; } }持久化类:
@Entity@Table(name="E_USER",unique ...
- 2009-08-18 18:05
- 浏览 1260
- 评论(0)
例如:有三个类 A B C 最终要持久化的类是A 而 B C 都作为组件内在与A B,C都要使用@Embeddable标注声明为一个组件
class A 代码:
@Entry
public class A{
private int id;
private B b;
private C c;
...
public B getB(){
...
}
public C getC(){
....
}
}
B 包含C
class B
@Embeddable
public class B{
private Stirng b ...
- 2009-08-18 17:54
- 浏览 879
- 评论(0)
hiberante sql映射对应
Java数据类型
Hibernate数据类型
标准SQL数据类型(PS:对于不同的DB可能有所差异)
byte、java.lang.Byte
byte
TINYINT
short、java.lang.Short
short
SMALLINT
int、java.lang.Integer
integer
INGEGER
long、java.lang.Long
long
BIGINT
float、java.lang.Float
float
FLOAT
double、java.lang.Doub ...
- 2009-08-18 16:58
- 浏览 1562
- 评论(0)
id生成:hibernate内不可使用的id生成器可见代码
使用@GeneratedValue1 正对不同的数据库可以同时使用 @Id @GeneratedValue(strategy = GenerationType.AUTO)2 针对mysql @Id @GeneratedValue(strategy = GenerationType.IDENTITY)3 针对oracle @Id @GeneratedValue(strategy = GenerationType.SEQUENCE,generator="s_gen") ...
- 2009-08-18 16:28
- 浏览 1315
- 评论(0)
为了追踪hibernate的信息 <property name="hibernate.show_sql">true</property>
新建User类:
@Entity @Table(name="E_USER",uniqueConstraints={ @UniqueConstraint(columnNames={"yahoo"}) }) public class User { private int id; private String yahoo; //昵称唯一@Id @GeneratedValu ...
- 2009-08-18 14:56
- 浏览 1085
- 评论(0)
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
slf4j-api.jar, slf4j-nop.jar,
- 2009-08-18 14:32
- 浏览 6174
- 评论(0)
转载请说明地址和作者
一,配置文件加载
1,Configuration
如果不是annoation则可以使用Configuration configuration = new Configuration();
使用annoation则可以使用Configuration configuration = new AnnotationConfiguration();
2,加载,使用onfiguration的configure方法根据方法参数可以有一下几种加载方式:
(1) configure();
吃方法会去 ...
- 2009-08-18 13:55
- 浏览 1065
- 评论(0)
1,iterator
<s:iterator id="obj" value="list" status="index">
<!---输出当前元素的属性-->
<s:property value="property"/>
<!---输出当前迭代元素的索引-->
<s:property value="#index.index"/>
<!---输出当前迭代了几个元素-->
<s:prope ...
- 2009-08-14 12:33
- 浏览 1035
- 评论(0)
java.lang.AbstractMethodError: org.apache.xerces.dom.DocumentImpl.setXmlVersion
- 博客分类:
- questions_hander
网上有一个解答:
The reason was in JVM version. Platforms where deployment was successful used JVM 1.5 but problematical one had JVM 1.6. SAX2DOM class from Java 1.6 has a call to DocumentImpl::setXmlVersion() from its setDocumentInfo(). The version of xerces library I used doesn't have this method - it' ...
- 2009-08-12 12:46
- 浏览 8889
- 评论(1)
mysql 的机制其实应该是这样的:当你数据库缓存中的数据量达到tmp_table_size时,它会自动提交一次,然后继续接下来的操作,每tmp_table_size刷新数据库缓存
MySQL 中的 BLOB 数据由四种类型体现,分别是 TINYBLOB 其容量为 256 字节、BLOB 其容量为 64KB、MEDIUMBLOB 其容量为 16MB、LONGBLOB 其容量为 4GB。
CLOB类型默认为1m 如果大于的话可能会出现
Packet for query is too large (37748784 > 1048576). You c ...
- 2009-08-10 10:50
- 浏览 1515
- 评论(0)
1,输出到文件 java Hello.java > hello.txt 也可以>>吧内容附加到后面
2,integer各种toXXX方法:Integer.toBinaryString(2147483647);Integer.toHexString(2147483647);Integer.toOctalString(2147483647)
3,System.out.printf("%x%n", 19);System.out.printf("%o%n", 19);System.out.printf("%d%n", 19 ...
- 2009-08-09 17:13
- 浏览 1314
- 评论(0)
http://gceclub.sun.com.cn/Java_Docs/jdk6/html/zh_CN/api/java/util/ResourceBundle.html
ResourceBundle类
ResourceBundle类主要作用是读取属性文件,读取属性文件时可以直接指定属性文件的名称(指定名称时不需要文件的后缀),也可以根据Locale所指定的区域码来选取指定的资源文件,ResourceBundle类的常用方法如表11-4所示。
表11-4 ResourceBundle类的常用方法
序号
方 法
类型
- 2009-08-08 23:54
- 浏览 2573
- 评论(0)
java.util.logging.Logger的使用
2009-07-22 20:13
1.在程序里面写死需要哪些log级别,使用哪些subscribe
import java.util.logging.*;public class LoggingProgramSetPubSubpro {public static void main(String[] args) { Logger logger = Logger.getLogger("loggingTest"); logger.setLevel(Level.INFO);//这个设定最重要 ...
- 2009-08-08 23:33
- 浏览 1206
- 评论(0)
DateFormat 来格式化日期
2009年01月21日 星期三 18:19
public static void main(String[] args) { Date date = new Date(); DateFormat dateFormat =new SimpleDateFormat("yyyy年MM月dd日EE"); System.out.println(dateFormat.format(date)); }
------------------------------------------------------------ ...
- 2009-08-08 23:22
- 浏览 1051
- 评论(0)