最近在做一个CMS管理项目,在RBAC模型创建时,遇到一个小疑问。
我们知道使用Hibernate可以使用many-to-many的注解或xml配置来自动完成多对多映射,例如:User Role Group三个对象,以User和Group为例。
在数据库表中必然存在一个t_user_group的table表,使用Hibernate完全可以在不建立UserGroup对象的情况就完...
分类:
Web程序 时间:
2015-01-27 13:21:40
阅读次数:
242
Oracle异常分类Oracle预定义异常(即已定义的内部异常)Oracle非预定义异常(即未定义的内部异常)用户自定义异常常见的预定义异常 NO_DATA_FOUND 语句没有查询出符合条件的记录返回TOO_MANY_ROWS 语句符合条件的记录有多条返回DUP_VAL_ON_INDEX 数据库表...
分类:
数据库 时间:
2015-01-27 11:01:11
阅读次数:
314
试想一个问题:如果我们需要给一个超类的方法实现一种更强的功能,也就是加强版的超类,一般会怎么做?继承?Too young too simple!看看下面的例子:当我们需要一个类,需要HashSet类的所有方法,但是随时需要知道在其创建到目前,已经加入过多少元素,该如何实现?一般使用继承,覆盖add(...
分类:
编程语言 时间:
2015-01-27 10:57:03
阅读次数:
197
add by zhj: 文中不仅列出了最常用的MQ,而且还列出了一些文章,分享使用的经验,值得一看原文:http://queues.io/AboutThere are many queueing systems out there. Each one of them is different and...
分类:
其他好文 时间:
2015-01-27 07:01:17
阅读次数:
417
Unique Binary Search TreesGivenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a to...
分类:
其他好文 时间:
2015-01-27 00:16:11
阅读次数:
218
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/43155725
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many tr...
分类:
其他好文 时间:
2015-01-26 22:57:31
阅读次数:
180
题目链接:传送门题目需求:Given integers N and M, how many integer X satisfies 1=M.(2=M。这才是核心:要求有多少个 i 满足gcd(i, N) = d(1=M,就是求N的因子中大于等于M的欧拉函数值,即gcd(N/d1)+gcd(N/d2)...
分类:
其他好文 时间:
2015-01-26 20:52:56
阅读次数:
202
Transportation
Ruratania is just entering capitalism and is establishing new enterprising activities in many fields including transport. The transportation company TransRuratania is star...
分类:
其他好文 时间:
2015-01-26 17:11:48
阅读次数:
243
题目:
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
我的解法:
(1)算法思想:
问题可以...
分类:
其他好文 时间:
2015-01-26 17:04:06
阅读次数:
200
题目:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty spac...
分类:
编程语言 时间:
2015-01-26 16:57:37
阅读次数:
161