-2
我是jsf和java的新手,现在正在使用jpa和jpql构建带有jsf的web项目。 现在,在我的项目写JPQL查询我这样做:Querydsl jpa入门
Query q = em.createQuery("SELECT a FROM Advert as a where a.razdel like ?1 and a.categoryId like ?2" );
但我已阅读,查询DSL是使用更更好,无限便捷。 所以我读过一些教程,发现有这样的:
Add the following dependencies to your Maven project and make sure that the Maven 2 repo of Mysema Source (http://source.mysema.com/maven2/releases) is accessible from your POM :
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mysema.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
但是,在添加此设置? 在我的项目中,我只有web.xml,persistence.xml,这就是全部?
这是Maven。所以学习[Maven](http://maven.apache.org/)或找到其他教程。 – 2014-11-05 12:59:34