mysql
文章平均质量分 51
catch1205
对语言和架构不懈追求
展开
-
mysql问题:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
First things first. Log in as root and stop the mysql daemon. sudo /etc/init.d/mysql stop Now lets start up the mysql daemon and skip the grant tables which store the passwords.sudo mysqld转载 2014-06-18 18:17:33 · 566 阅读 · 0 评论 -
Hibernate的auto-import属性详解
auto-import是什么意思呢?我们经常会写这样一个HQL语句:from User u where u.name='罗灿锋';绝大多数时候,这样写是不会发生问题的。hibernate在处理这个HQL时,会先将其翻译成一条数据库能够识别的sql语句。翻译的依据当然是实体与数据库表之间的映射关系了。现在我们就给他制造一些问题,我们让hibernate同转载 2015-03-25 19:20:26 · 512 阅读 · 0 评论 -
spring配置packagesToScan的问题
spring配置packagesToScan的问题 使用spirng配置pojo映射时,我们通常会使用packageToScan来简化映射配置,而且通常会使用通配符简化配置代码;比如你的model文件都在com.study.hibernate.entity包下,则配置packageToScan时不能配置成:<property name="packagesToScan"> <list>原创 2015-11-27 11:25:53 · 6836 阅读 · 0 评论 -
spring整合hibernate时lazy加载失败问题
1. 环境:spring4hibernate4mysql 5.62. 原始问题现象:假设有两个表student和teacher,teachet是student的ManyToOne外键字段,设置如下属性:@OneToOne(fetch = FetchType.LAZY, mappedBy = "student") 当没有在spring配置的transaction中直接如此:student.g原创 2016-01-05 15:52:53 · 1225 阅读 · 0 评论