
JAVA语法
line_aijava
这个作者很懒,什么都没留下…
展开
-
HQL查询需要的某些字段,提高查询速度
普通的HQL语句“ From Student ”如果查询某些字段的话,需要在实体类中先添加某些字段的构造方法,比如查询id,name,在Student中添加构造方法public void Student(int id, String name){this.id原创 2011-07-05 14:40:59 · 731 阅读 · 0 评论 -
switch case 使用
String str = "";int i = 1;switch (i){case 1:str = "传入了1";break;case 2: str = "传入了2";break;default :str = "传入了其他值";}switch()括号里的值1.5之前是只能传入 整形和char类型1.6之后貌似是可以用字符串了。原创 2011-04-02 09:19:00 · 661 阅读 · 0 评论