Dev@Free

zJun's Tech Weblog

     摘要: Java Socket简单入门例子.  阅读全文
posted @ 2007-07-24 19:01 zJun's帛罗阁 阅读(2278) | 评论 (1)编辑 收藏
摘自: ziyang之窝


有两个表:

Menu,Privilege,他们是多对多关系,有一个中间表menu_privilege,在Menu中有privileges List字段,而在privilege中则没有menu List字段,因为privilege不想依赖于Menu。但我们要根据Privilege得到其所有的Menu,则HQL应该这样写:

Query query  =  session.createQuery( " select menu from Menu menu left join menu.privileges p where p.id=:id " );
                
query.setParameter(
" id "
, privilege.getId());
return
 query.list();
posted @ 2007-07-24 18:22 zJun's帛罗阁 阅读(2483) | 评论 (0)编辑 收藏
Dear all:
result love(boy, girl)
{
  if ( boy.有房() and boy.有车() )
   {boy.set(nothing);
    return girl.嫁给(boy); }
  if ( girl.愿意等() )
  {
while( ! (boy.赚钱 > 100,000 and girl.感情 > 8 )
   {for ( day=1; day <=365; day++)
    {if ( day == 情人节 )
     if ( boy.give girl(玫瑰) )
      girl.感情++;
     else
      girl.感情--;
     if( day == girl.生日)
     if ( boy.give girl(玫瑰) )
      girl.感情++;
     else
      girl.感情--;
      boy.拼命赚钱();
      }
     }

  if ( boy.有房() and boy.有车() )
   { boy.set(nothing);
 return girl.嫁给(boy);
 }
    年龄++;
   girl.感情--;
  return girl.goto( another_boy);
}

(注:稍懂点C语言的应该都能看懂吧!)
posted @ 2007-03-09 14:03 zJun's帛罗阁 阅读(907) | 评论 (1)编辑 收藏
     摘要: 组件(Component)类必须在类一级定义@Embeddable注解.

在特定的实体的关联属性上使@Embedded和@AttributeOverride注解可以覆盖该属性对应的嵌入式对象的字段映射:  阅读全文
posted @ 2007-03-07 16:17 zJun's帛罗阁 阅读(2985) | 评论 (0)编辑 收藏
     摘要: 1.简单主键:
使用@Id注解可以将实体bean中的某个属性定义为标识字段.使用 @GeneratedValue注解可以定义标识字段的生成策略:

AUTO - 可以是identity类型的字段,或者sequence类型或者table类型,取决于不同的底层数据库.
TABLE - 使用表保存id值
IDENTITY - identity字段
SEQUENCE - sequence  阅读全文
posted @ 2007-03-07 15:49 zJun's帛罗阁 阅读(2532) | 评论 (0)编辑 收藏
     摘要: 1. 基本属性映射
通过 @Basic 可以声明属性的存取策略:
@Basic(fetch=FetchType.EAGER) 即时获取(默认的存取策略)
@Basic(fetch=FetchType.LAZY) 延迟获取  阅读全文
posted @ 2007-03-07 15:13 zJun's帛罗阁 阅读(2077) | 评论 (0)编辑 收藏
     摘要: Displaytag1.1支持在外部实现大数据量分页。主要有两种方式实现:

Displaytag 1.1 offers two alternative ways for working with partial lists:

the first one uses the valuelist pattern, and requires that the object that you give to displaytag implements the org.displaytag.pagination.PaginatedList interface. You can pass this object to displaytag as an usual list, and it will extract paging and sorting information from it. This way is more recommended if you have to build your backend layer and you can easily  阅读全文
posted @ 2007-02-08 11:35 zJun's帛罗阁 阅读(7424) | 评论 (20)编辑 收藏

1.打开 Google主页

2.把浏览器地址栏清空,再将下面的内容复制到地址栏内:

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5); void(0);

3.回车....

posted @ 2007-02-02 14:41 zJun's帛罗阁 阅读(715) | 评论 (0)编辑 收藏
     摘要: Launchy,一款免费开源软件实现了键盘快捷启动程序的功能。

你只需要输入程序的名称,Launchy就可以自动帮你匹配出你想要运行的程序:  阅读全文
posted @ 2007-02-02 14:36 zJun's帛罗阁 阅读(1110) | 评论 (0)编辑 收藏
     摘要: Table
Table用来定义entity主表的name,catalog,schema等属性。
元数据属性说明:
name: 表名
catalog: 对应关系数据库中的catalog
schema:对应关系数据库中的schema
UniqueConstraints:定义一个UniqueConstraint数组,指定需要建唯一约束的列   阅读全文
posted @ 2007-01-24 15:46 zJun's帛罗阁 阅读(21963) | 评论 (0)编辑 收藏
     摘要: Apache的Jakata项目的POI子项目,目标是处理ole2对象。 POI可以到 http://www.apache.org/dyn/closer.cgi/jakarta/poi/ 下载。...  阅读全文
posted @ 2007-01-22 17:59 zJun's帛罗阁 阅读(22196) | 评论 (6)编辑 收藏
     摘要: 方法一:循环元素删除
方法二:通过HashSet剔除
方法三:删除ArrayList中重复元素,保持顺序  阅读全文
posted @ 2007-01-18 13:48 zJun's帛罗阁 阅读(4628) | 评论 (0)编辑 收藏
更新列表: http://dev.rubyonrails.org/browser/spinoffs/prototype/CHANGELOG

 下载:  http://dev.rubyonrails.org/browser/trunk/railties/html/javascripts/prototype.js
posted @ 2007-01-17 18:01 zJun's帛罗阁 阅读(740) | 评论 (0)编辑 收藏
     摘要: As per the documentation on MySQL I moved the storage of passwords from using Password() to using MD5(). I read a number of places that stated that this was a method that couldn't be reversed and it was far more secure than the previous method. I was feeling confident that life was about to get a little more secure. While going through my daily RSS feeds and mailing lists for SpikeSource, I happenned upon a thread about someone discussing how easy it was to break MD5 hashes. It was a simple matt  阅读全文
posted @ 2007-01-17 16:22 zJun's帛罗阁 阅读(2568) | 评论 (0)编辑 收藏
     摘要: name="resultList" 将记录集存在session或者request中的键值
pagesize="100" 每页显示100条数据
sort="external" 外部排序
id="row" 表格id值,用于程序得相关的参数
partialList="true" 分段从数据库中读数据
size="resultSize" 记录的总条数,用于计算总页数  阅读全文
posted @ 2007-01-17 15:04 zJun's帛罗阁 阅读(5292) | 评论 (3)编辑 收藏
     摘要: Apache jakarta 各项目主要用途及简单说明 来源出处:http://www.javaworld.com.tw/jute/post/view?bid=11&id=1672 为了让大...  阅读全文
posted @ 2007-01-16 17:07 zJun's帛罗阁 阅读(1421) | 评论 (0)编辑 收藏
一定得是N层结构,
层数越多越好,层少了用户会误会我们不重视,
什么数据访问层呀,实体控制层啊,能给他加上的全加上。
    
程序员一定都得是老鸟,30以下基本不考虑,
还得清一色的外企空降兵,
都有10年以上编程经验的那种,用过的语言越多越好,
编程都不带查MSDN的,牛吧!
程序员个个都配IBM笔记本,
CPU要3G以上的,内存硬盘和屏幕都要最大的,
扩展槽别剩下,能插上的全插上。
能安的操作系统全安上,开机一屏幕上就一堆系统等你选,
倍有面子!
    
系统平台就得是J2EE,人家竞争对手除了C++就是JAVA,
你要用一.NET都不好意思和别人打招呼。
你说这样的系统设计出来得卖多少钱?
我觉得怎么也得100万吧?
100万,那是单机版!
1000万起!
你还别嫌太贵,还不免实施服务费。
你得研究有钱用户得心理,
愿意花1000万买这套软件用的,
根本不在乎再多花上几百万!
    
什么叫软件泡沫你知道么?
软件泡沫就是做都做最复杂的,
用就得用最贵的,还得特难用,显得用户水平高。
所以我们搞软件的口号就是:
不求好用,但求费劲!
posted @ 2007-01-12 17:36 zJun's帛罗阁 阅读(482) | 评论 (0)编辑 收藏
     摘要: 参考文档:使用 Spring 更好地处理 Struts 动作

可以通过三种方式实现Spring管理Struts Action:
1.使用 Spring 的 ActionSupport 类整合 Structs
2.使用 Spring 的 DelegatingRequestProcessor 覆盖 Struts 的 RequestProcessor
3.将 Struts Action 管理委托给 Spring 框架   阅读全文
posted @ 2007-01-08 16:57 zJun's帛罗阁 阅读(1809) | 评论 (0)编辑 收藏
     摘要: DCBP连接池的简单使用方法。  阅读全文
posted @ 2006-11-10 13:49 zJun's帛罗阁 阅读(1194) | 评论 (3)编辑 收藏
     摘要: 元字符及其在正则表达式中行为的列表  阅读全文
posted @ 2006-10-11 13:52 zJun's帛罗阁 阅读(2246) | 评论 (0)编辑 收藏
仅列出标题
共5页: 上一页 1 2 3 4 5 下一页 

导航

<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

统计

常用链接

留言簿(15)

随笔分类

随笔档案

相册

收藏夹

博客

文档

站点

论坛

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜