One of the properties in my entity is mapped to bpchar (BLANK PADDED CHAR) string.
@NotNull
@Column(name = "property", columnDefinition = "bpchar")
private String property;
When I save entity and load back, then my property is padded with spaces, that is correct from the database point of view.
But I want to work in code with trimmed...
I am using Websphere application server 7.0.0.0.9 with ;OpenJPA 1.2.3-SNAPSHOT'.
I have Set property of jdbc data source webSphereDefaultIsolationLevel=2 (READ COMMITTED).
I have this question because My understanding is the OptimasticLockException occurs if there is race to commit the same row by multiple thread.
But I think this sit...
I've encountered a problem I don't really understand - unless a method working with the DAO is annotated as @Transactional, the underlying database doesn't get updated. My app runs on JPA/Hibernate, Spring and Wicket. Why is that?
DAO:
@Repository(value = "userDao")
public class UserDaoJpa implements UserDao {
@PersistenceContext
...
My application runs on JPA/Hibernate, Spring and Wicket. I'm trying to convert our ORM from XML files to JPA annotations. The annotated model looks like this:
@Entity
@Table(name = "APP_USER")
public class User extends BaseObject {
private Long id;
private String firstName;
private String lastName;
private String email;
...
Our project has just decided to migrate from Spring 2.5.5 to Spring 3.0.4. In my original code, I had unit tests that looked like the following:
public class RequisitionDaoTest extends AbstractJpaTests
{
public static String FAIL_MSG_UNEXPECTED_ERROR = "FAIL: Unexpected Error";
@PersistenceContext
private EntityMa...
Hi,
I have a CriteriaBuilder and am trying to create a predicate to restrict results in a CollectionAttribute. I would like to say something like get all entities in this collection where the entity's attribute A equals x. For example, I have lots of People entities. They have a collection of job titles (previous and current) and I'd lik...
Hey guys,
I've implemented an EJB3/JPA web service without any major problems, and now I've moved on a Spring-WS/JPA web service. Both are being deployed to Glassfish.
My understanding of JPA is limited, but by default transactions are container managed? How do you change this? With EJB3 things were straight forward as I could just inj...
I'm trying to include persistence to a Vaadin project so my first step was to try the JPA+Address Book Demo using Netbeans. When I try to run the demo I get a "StandardWrapperValve[VaadinApplication]: PWC1406: Servlet.service() for servlet VaadinApplication threw exception".
I tried by adding gwt-user.jar but it didn't work. My knowledg...
I am facing issue to override persistence.xml in jboss and with Hibernate JPA provider, I spent couple of nights but I couldn't solve it. I am using jboss + hibernate + mysql + ejb3. My requirement is I will provide the connection URL and the persistence unit will connect to the DB but it will be dynamically. so my code below. If anyone ...
Hi guys,
I'm working on a program that parses data from a file and stores it into a HSQLDB database. As the parser encounters data it creates entities which are mapped to the database using JPA/Hibernate. My problem is that while the parsing is being performed the application uses more and more memory. I have successfully used cached ta...
I'm using OpenJPA and want to configure it to use Autocommit on every write/insert operation.
At the moment I have to do this:
MyEntity e = new MyEntity();
em.getTransaction().begin();
em.persist(e);
em.getTransaction().commit();
What I want to be able to do is this:
MyEntity e = new MyEntity(); ...
LinkedIn provides a mechanism to say that the user was part of a search criteria "n" number of times in the last "x" days. How do you go about capturing and storing the information. Are you supposed to iterate the search results and put an appropriate counter whenever they get searched or is there a non-intrusive mechanism by which this ...
Do not close this as a duplicate of other questions because I'm not asking the same thing. They're also about a year old. That said, see these links:
http://db.apache.org/jdo/jdo_v_jpa.html
http://www.datanucleus.org/products/accessplatform/jdo_jpa_faq.html
http://www.datanucleus.org/products/accessplatform/persistence_api.html
It se...
I am having trouble working out how to do a bulk delete of a Person object using JPA, when the Person objects contain data stored using an @ElementCollection. Any ideas on how to do this would be much appreciated.
@Entity
@Table(name="at_person")
public class Person implements Comparable<Person> {
@Id
@GeneratedValue(strategy =...
Hi,
Can anyone tell me what is the difference between JTA, JPA, and Plain JDBC in terms of hibernate? I have been asked continuously this question and I fumble while giving the answer.
Best Regards,
Aashutosh
...
I am getting following exception while i try to execute simple jpa code.
What may be the casue?
5453 DevPQRWDPBSSPersist WARN [P=351601:O=0:CT] openjpa.Enhance - This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "[class com.XYZ.PQ...
According to the Hibernate Reference Documentation it should be possible to mix different inheritance mapping strategies when using Hibernate's XML-Metadata:
http://docs.jboss.org/hibernate/stable/core/reference/en/html/inheritance.html#inheritance-mixing-tableperclass-tablepersubclass
However, the corresponding section of the Hibernate...
I'm using hibernate as my jpa provider and want it to create a
in-memory hsqldb on startup using:
hibernate.hbm2ddl.auto=create
But for some reason I get exceptions like below in my logs.
Things seems to work otherwise. Is it a hibernate or hsqldb problem?
I'm limited to using jpa 1 so I'm using
hsqldb 1.8.0.10 and hibernate 3.3.0.SP...
Basically it doesn't work ... I can install the jdbc driver for pg 90 in netbeans and browse the database, issue sql commands etc. But creating entity beans from the tables via the same connection does not work, Netbeans can't find any tables in the database. Do I have to downgrade to pg 84, or are there some tricks to make it work?
...
Aloha,
I'm currently working on a desktop application using JPA/Hibernate to persist data in a H2 database. I'm curious what my options are if I need to make changes to the database schema in the future for some reason. Maybe I'll have to introduce new entities, remove them or just change the types of properties in an entity.
Is there...