jpa-2.0

Eclipselink 2.4 + JPA + ManyToMany with additional column

和自甴很熟 提交于 2019-12-24 03:49:15
问题 I'm developing a student manager application in Java with JPA entities provided by Eclipselink. I'm trying to implement a many-to-many relationship between two entities for a while, but I ran into some weird exceptions. My implementations are based on: Java persistence Wiki page of ManyToMany relationship and this StackOverflow post. Here is my Homework.java file's relevant parts: @Entity @Table(name = "db_homework") public class Homework { @Id @GeneratedValue(strategy = IDENTITY) private

eclipse 4.3 EE facet jpa 2.0 build error

限于喜欢 提交于 2019-12-24 02:42:31
问题 I'm trying Eclipse Kepler 4.3 EE After open it over my old workspace, my project starts with an build error: This project has the JPA facet, but no JPA project could be created. See the error log for more details. This is the details: eclipse.buildId=4.3.0.I20130605-2000 java.version=1.7.0_21 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -data D:\JJW

eclipse 4.3 EE facet jpa 2.0 build error

旧街凉风 提交于 2019-12-24 02:42:26
问题 I'm trying Eclipse Kepler 4.3 EE After open it over my old workspace, my project starts with an build error: This project has the JPA facet, but no JPA project could be created. See the error log for more details. This is the details: eclipse.buildId=4.3.0.I20130605-2000 java.version=1.7.0_21 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -data D:\JJW

integrating JPA and SpringIOc

只愿长相守 提交于 2019-12-24 02:06:45
问题 Hi I write small application and trying connect jpa. in my spring configuration file I write this: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driver.manager}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.login}" /> <property name="password" value="${jdbc.password}" /> </bean> <bean id="entityManagerFactory" class="org.springframework.orm.jpa

integrating JPA and SpringIOc

左心房为你撑大大i 提交于 2019-12-24 02:06:31
问题 Hi I write small application and trying connect jpa. in my spring configuration file I write this: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="${jdbc.driver.manager}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.login}" /> <property name="password" value="${jdbc.password}" /> </bean> <bean id="entityManagerFactory" class="org.springframework.orm.jpa

maven-processor-plugin to ignore undefined symbols

[亡魂溺海] 提交于 2019-12-24 01:58:08
问题 I've JPA 2 maven project and I want to process sources to have the static meta model. What I did I took JBoss' static meta model processor and set it up to run during generate-sources phase. Now, obviously I have some classes that reference the meta model and compilation itself goes fine. But maven-processor-plugin itself generates errors complaining that it can't find symbols from meta model like this: [INFO] --- maven-processor-plugin:2.2.4:process (process) @ ng-grid-java --- [ERROR]

Mixed parameter strategies - use just one of named, positional or JPA-ordinal strategy

拟墨画扇 提交于 2019-12-24 01:11:19
问题 I am calling function from Oracle database and facing this Exception: org.hibernate.engine.query.ParameterRecognitionException: Mixed parameter strategies - use just one of named, positional or JPA-ordinal strategy This is my User.java entity. @Entity @Table(name = "users", schema = "myschema") @javax.persistence.NamedNativeQuery(name = "getPass", query = "{? call = his.get_abc(:mrno)}", resultClass = User.class, hints = { @javax.persistence.QueryHint(name = "org.hibernate.callable", value =

Bean Validation Through JPA Relationships

萝らか妹 提交于 2019-12-24 00:12:24
问题 I would like to use Bean Validation to annotate constraints in my entities , now the question is, will the relationships on the entities be validated as well?. For example suppose I have the following entities: @Entity @Table(name = "css_empresa") public class Empresa extends EntidadContactable implements Serializable, Convert { private static final long serialVersionUID = 1L; @Id @SequenceGenerator(name = "EMPRESA_ID_GENERATOR", sequenceName = ConstantesSecuencias.SEQ_EMPRESA)

Unable to configure EntityManagerFactory from runnable jar

早过忘川 提交于 2019-12-24 00:08:33
问题 I'm developing a JPA-2.0 application using Hibernate3. It runs fine from eclipse, but if run it from a generated runnable jar, it gives a javax.persistence.PersistenceException: Unable to configure EntityManagerFactory: Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke

Hibernate Entity manager auto flush before query and commit changes to DB in transaction

淺唱寂寞╮ 提交于 2019-12-23 18:21:06
问题 I am using Hibernate 3.6.0 with JPA 2 on Jboss AS 6.0.0 final. In an EJB of mine, there's a method which updated entity values and do some query on it. The whole method is running in a BMT transaction. If anything fails, all changes should be rollback and not committed to DB. The Database is mySql. Before running JPA query, JPA will auto flush the changed states to DB to prevent any stale data from returning. However, within my method, the auto-flush directly update and commits the changes to