Questions tagged [jpa-1.0]

This tag is for questions about the version 1.0 of the Java Persistence API. JPA 1.0 is the first version of the Java Persistence API specification.

This tag is for questions about the version 1.0 of the Java Persistence API. JPA 1.0 is the first version of the Java Persistence API specification.

JPA 1.0 was released as part of the EJB 3.0 specification under JSR 220, but it can also be used in a Java SE application. JPA was meant to supersede EJB Entity Beans. Entity beans continue to be supported for backward compatibility. Any bean managed by JPA is no longer called an entity bean; instead, it is merely referred as an entity.

22 questions
186
votes
8 answers

JPA OneToMany not deleting child

I have a problem with a simple @OneToMany mapping between a parent and a child entity. All works well, only that child records are not deleted when I remove them from the collection. The parent: @Entity public class Parent { @Id @Column(name…
bert
  • 7,566
  • 3
  • 31
  • 47
4
votes
3 answers

JPA 1.0 error: The name is not a recognized entity or identifier. Known entity names: []

I am getting following exception while I try to execute simple JPA 1.0 code. What may be the cause? 5453 DevPQRWDPBSSPersist WARN [P=351601:O=0:CT] openjpa.Enhance - This configuration disallows runtime optimization, but the following listed…
akp
  • 1,823
  • 7
  • 26
  • 29
2
votes
0 answers

HQL-query with discriminator column cannot query by type of subclass

I'm using JPA1.0 and Hibernate 3.3. (There is currently no option to upgrade). I want to query a generic table GenericOrderType with @Inheritance(strategy = InheritanceType.SINGLE_TABLE) strategy and @Discriminatorcolumn(name="ORDER_TYPE"). Running…
feder
  • 1,849
  • 2
  • 25
  • 43
2
votes
1 answer

Alternative to @ElementCollection using JPA 1.0 for persisting Map?

I'm trying to persist a simple Map of attributes as a key value pair for one of my persisted objects. I found a good guide on this matter here. But it only shows how to map when the value of the key is a mapped object (with a 'mapped by' property).…
L. Holanda
  • 4,432
  • 1
  • 36
  • 44
1
vote
1 answer

ejb3 toplink jpa 1.0 querying and id sequence strategy

I have 2 questions: suppose we have one entity named class and another called student. each class has onetomany students. public class Clas implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private int…
Tommy
  • 55
  • 1
  • 6
1
vote
3 answers

JPA 1.0: How to write an efficient transformer from an entity to a transfer object?

I want to write an efficient transformer, that will transform a JPA (1.0) entity to my transfer object and that: will be called in a transactional context, will cause no extra DB interaction, that is will transform only what's already loaded. I…
MaDa
  • 10,511
  • 9
  • 46
  • 84
1
vote
1 answer

Question about concurrency with jpa 1.0 transactions

Currently we're creating a single EntityManager per request in our web app. We're wanting to create a transaction at the beginning of the request and close it at the end to get automatic transaction support throughout the entire request. Has…
joekarl
  • 2,118
  • 14
  • 23
1
vote
1 answer

org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean is failing after upgrading spring–orm jar to 4.1.6

Initially in our project we were using spring 3 + hibernate 3 Recently it has been decided to upgrade 3rd party jars, as part of that spring upgraded to 4 but not hibernate (still hibernate 3 is maintained). Now we have not changed any code for…
JB.
  • 41
  • 8
1
vote
0 answers

Named-Native Query's parameters not detected in JPA 1.0

I using Named native query in orm.xml. I wrote a query to fetch Ids from a particular table. Since I just want to return the result, I wrote a dummy result set mapping. I get the following error : could not locate named parameter [1] But this way…
user2434
  • 6,339
  • 18
  • 63
  • 87
1
vote
1 answer

JMS doesn't rollback XA transaction (or doesn't participate in one)

I'm relatively new to XA transactions. I've been struggling a few days to make a simple XA transaction work to no avail. First, I tried to use two different databases. I set up 2 XA datasources and had succeeded in rolling back the first database…
jFrenetic
  • 5,384
  • 5
  • 42
  • 67
1
vote
1 answer

PersistenceProvider not found Exception in JBOSS AS 5.1.0 GA

I am trying to deploy the product in JBOSS AS 5.1.0 GA using eclipse in Linux. Previously it was executed successfully on tomcat 6. While deploying I got many errors. I had solved one by one. But now ClassNotFoundException raised due to the…
1
vote
2 answers

How can a JPA 1.0 project be converted to JPA 2.0?

We've been using JPA 1.0 for some time now. We want to move ahead to JPA 2.0. How can this be done?
Ravindranath Akila
  • 209
  • 3
  • 35
  • 45
1
vote
1 answer

Hibernate List Java Persistence 1.0

I seem to have problems with mapping a List in Hibernate. In our project there is a class Profile, it contains a List. Is List mappable by Hibernate using annotations, using Java Persistence 1.0 (NO ElementCollection!)? (annotations…
0
votes
2 answers

ejb3 toplink jpa 1.0 querying and sequencing

I have 2 questions: suppose we have one entity named class and another called student. each class has onetomany students. public class Clas implements Serializable { @Id @GeneratedValue(strategy=GenerationType.SEQUENCE) private int…
Tommy
  • 55
  • 1
  • 6
0
votes
1 answer

when persisting an entity with auto generated PK in JPA

@Id @GeneratedValue(strategy = GenerationType.IDENTITY) Column(name = "CNTNR_SHPMNT_NUM") @XmlAttribute(name = "cntnrShpmntNum") private Long cntnrShpmntNum; I have a Table with name CNTNR and I made its primary key as generated with identity…
vishnu
  • 3,985
  • 4
  • 19
  • 6
1
2