-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