- 博客(5)
- 收藏
- 关注
原创 Springboot多配置文件注入
启动类中加入 @ImportResource(locations = {"classpath:bean.xml"})来引入XML文件中配置的bean在实体类中加入注解@ConfigurationProperties(prefix = "前缀")并在application.yml中使用上边注解配置的前缀...
2022-06-29 00:02:58
154
1
原创 HQL 多对多查询写法
List infolist = new ArrayList();infolist = getHibernateTemplate().find("select i FROM Information i join i.channels c where c.id=? ",delChannel.getId());for(int i=0;iInformation info = infolist.
2017-07-25 17:08:17
1150
转载 windows linux 下,获取java项目绝对路径的方法
struts2设置了struts.multipart.saveDir后会在根目录建立文件夹,这样会涉及linux下的权限问题,最好不要设置,使用struts默认需要使用路径时,用下面的方法取得项目根目录的绝对路径(Tools为方法类)public static String getRootPath() { String classPath = Tools.class.
2017-07-19 10:35:19
1593
转载 javascript、jquery获取网页的高度和宽度
javascript:可视区域宽 :document.documentElement.clientWidth (width + padding)可视区域高 :document.documentElement.clientHeight (height + padding)可视区域宽: document.body.offsetWidth (包括边线的宽: widt
2017-07-03 17:31:21
247
转载 Hibernate操作时间需要注意的问题(转)
hibernate很大的一个特点就是屏蔽了数据库的差异,使用了hibernate就应该尽量HQL来操作数据库(除非不得不用数据库本身的一些特性),而对于时间类型的比较hibernate也是支持的。HQL: and acceptDate用一个时间类型来替换参数end:query.setDate("end",endDate);顺便在提一个问题,我们经常碰到查询从A(起始时期)到
2017-06-01 16:25:22
1077
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人