我遵循symfony2教程,我一步到位就遇到了问题。
教程链接:http://intelligentbee.com/blog/2013/08/12/symfony2-jobeet-day-6-more-with-the-model/
我在'重构'一步。我有一个这3个步骤:
1-我已正确修改指定存储库的/src/Ibw/JobeetBundle/Resources/config/doctrine/Job.orm.yml文件
2-我运行命令:php app / console doctrine:generate:entities IbwJobeetBundle
3-我已经添加了指定的教程函数por JobRepository.php
$qb = $this->createQueryBuilder('j')
->where('j.expires_at > :date')
->setParameter('date', date('Y-m-d H:i:s', time()))
->orderBy('j.expires_at', 'DESC');
但是当我刷新我的代码时,我收到了这个错误:
执行'SELECT j0_.id AS id0,j0_.type时发生异常 AS type1,j0_.company AS company2,j0_.logo AS logo3,j0_.url AS url4, j0_.position AS position5,j0_.location AS location6,j0_.description AS description7,j0_.how_to_apply AS how_to_apply8,j0_.token AS token9,j0_.is_public AS is_public10,j0_.is_activated AS is_activated11,j0_.email AS email12,j0_.expires_at AS expires_at13, j0_.created_at AS created_at14,j0_.updated_at AS updated_at15, j0_.category_id AS category_id16 FROM Job j0_ WHERE j0_.expires_at> ? ORDER BY j0_.expires_at DESC'with params [“2016-03-17 15:47:19”]:
SQLSTATE [42S02]:未找到基表或视图:1146表'jobeet.Job' 不存在
在symfony探查器中,我可以看到完整的查询:
SELECT j0_.id AS id0,j0_.type AS type1,j0_.company AS company2, j0_.logo AS logo3,j0_.url AS url4,j0_.position AS position5, j0_.location AS location6,j0_.description AS description7, j0_.how_to_apply AS how_to_apply8,j0_.token AS token9,j0_.is_public AS is_public10,j0_.is_activated AS is_activated11,j0_.email AS email12,j0_.expires_at AS expires_at13,j0_.created_at AS created_at14,j0_.updated_at AS updated_at15,j0_.category_id AS category_id16 FROM Job j0_ WHERE j0_.expires_at> “2016年3月17日 15:47:19'ORDER BY j0_.expires_at DESC
表名是大写的! '工作',而不是'工作'
有人可以帮帮我吗?
答案 0 :(得分:0)
您可以尝试通过添加case class TestTarget(tacticId: String, partnerId:Long)
class Job(conf: AdfinConfig)(implicit env: ExecutionEnvironment)
extends DspJob(conf){
...
words.join( ....)
...
}
属性修改Job.orm.yml
中的实体定义:
table