0

我有一个原则 2 用户实体,我尝试使用电子邮件找到它。

这是代码:

在此处输入图像描述

这是我得到的查询

SELECT t1.username AS username2, t1.email AS email3, t1.display_name AS display_name4,     t1.password AS password5, t1.user_id AS user_id6, t1.surname AS surname7, t1.lastname AS lastname8, t1.avatar AS avatar9, t1.phone AS phone10, t1.birthday AS birthday11, t1.title AS title12, t1.salon AS salon13
FROM user t1
WHERE t0.email = ?
LIMIT 1

那么它从哪里得到 t0 呢?它在其他地方使用 t1 吗?

我得到的错误是

SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.email' in 'where clause'
4

2 回答 2

1

仅供参考,如果您有像“UserSuper > GenericUserClass”这样的类继承,则类 GenericUserClass 应该是 @MappedSuperClass 而不是 @Entity。

于 2014-02-06T19:30:31.513 回答
0

添加电子邮件属性后,您可能尚未更新数据库架构。

如果您使用的是 symfony2,请尝试运行

php app/console doctrine:schema:update --force
于 2012-07-05T23:49:51.627 回答