This is a pretty newbie question- please know I'm aware of that.
I have a stateless session bean that needs to load up some data once and cache it locally in a static variable for use by all instances of that bean. The data can be accessed through an entity bean. I'm wondering if its safe to cache the entity instance, or if I should c...
I am having a strange problem. But first the orm.xml:
<entity class="de.test.businessobjects.Repeat">
<table name="repeat"/>
<attributes>
<id name="id">
<generated-value strategy="TABLE"/>
</id>
<many-to-one name="repeatType" fetch="LAZY">
<join-column name="id_repeatType"/>
...
Hi,
The terms "jta-datasource" and "resouce-local datasource" are a little vague to me. I'm putting down what I am understanding ( or assuming ) and I'd like you to say where I'm right / wrong.
The same database can be referred to as a jta-datasource or as a resource local datasource
If mentioned as jta-datasource, then the beans / o...
I am newbie with JPA. I'm trying to run some sample code using JPA but I get the following exception:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named MyJPAApplicationPU
I put my exception message here,
INFO: Could not find any META-INF/persistence.xml file in the classpath
javax.persistence.Per...
Hi,
I like to use jpa, but without application container.
I intend it to use it in console application.
Is there any example ?
Regards
...
Env: JPA 1, Hibernate 3.3.x, MySQL 5.x
We auto generate database schema using hbm2ddl export operation. Would it be possible to generate a default value for a certain @Entity member during SQL generation. (e.g. archive field in mytable entity class.
create table mytable (
...
'archive‘ tinyint(1) default ’0 ’,
...
)
...
Hi
I am using Hibernate / Spring / Maven / MySQL and unit tests with JUnit. Up to yesterday, my testdata persisted in the database even after the test run was completed. I configured the hell out of this day and all of the sudden all data are being deleted after every test run. Quite sure, this is no bug, but a config issue. Nevertheles...
Hi
My basic question is: How can I force Hibernate to make float NULLable and accept NULL for float, datetime, blob, respectively? I really mean NULL, not (float) 0.0.
Even worse, when I try to store an object with the desired NULLable fields actually being NULL and using entity manager, I get errors for attributes, which are marked as...
We have the simplest CRUD task with JPA 1.0 and JAX-WS.
Let's say we have an entity Person.
@Entity
public class Person
{
@Id
private String email;
@OneToOne(fetch = FetchType.LAZY)
@JoinColumn(insertable = false, updatable = false)
private ReadOnly readOnly;
@Column
private String name;
@XmlElement
p...
I am developing a Java Application that uses Hibernate and is connected to an Oracle instance. Another client is looking to use the same application, but requires it run on MS SQL Server. I would like to avoid making changes to the existing annotations and instead create a package of xml files that we can drop in depending on the environ...
Hi everybody,
I'd like to create one Bundle that is able to use Java Persistence. To achieve this, I've created a plugin project within Eclipse. In my project, I've created a persistence.xml file into META-INF. I've aslo added in my MANIFEST.mf (into the depencies) those 3 packages :
javax.persistence.jar
org.eclipse.persistence.jar
o...
Hi!
I'm trying integrate spring with hibernate but catch exception on project start.
Caused by: org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.domain.Worker"/
My config:
from spring
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="clos...
I was wondering if anyone has experience with the JPA2.0 implementation of any of those frameworks? Especially together with Spring3.x which comes with EclipseLink support.
Do you use any of those frameworks and JPA2.0 for production? Any severe issues?
...
I'm new to JSF and am wondering if I got things right. Let's say I have a simple CMS that makes it possible to write pages.
First, I define a JPA entity called Page:
@Entity
public class Page {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column
private Long id;
@Column private String title;
@Column private Strin...
I think that it makes sense for the entity variables to not be final as they are synchronized with the DB, but why for class and methods ??
...
Hi!
I wonder about a good way to have an EntityManager in each Bundle. Or how to use correctly JPA in an OSGi program.
Actually, I've one main bundle that loads the persistence.xml file and instanciates the EntityManager. After, my main bundle gives the instance of Entity manager to the other bundles via the services. So I use the powe...
Hi guys,
I am building a billing system. The system needs to generate monthly invoices to Clients.
What I am doing now is using a For loop to check all the clients their previous invoices and decide if it is the time to generate a invoice for the client.
If there are huge number of clients in the database, I think it could be very ...
I am using Hibernate JPA 1.0.
I have the following type of model and I consider manyToOne and oneToOne relationships "eagerly" fetched and oneToMany "lazily" fetched.
I want to fetch Entity A and all its associations where a.id=?
A oneToMany B
B oneToOne C
C oneToMany D
B oneToOne E
E oneToMany D
B oneToOne F
F oneToMany D
...
This is a fairly lengthy (not overly complex) design question so please bear with me. I'm trying to implement a person/role management system with POJOs and JPA. I'm fairly new to ORM and this is mostly a mapping problem.
I've got this working as POJOs and am comfortable with the caller-level API, but would now like to map it to a datab...
are there any tools which would read a data model exposed via ActiveRecord and generate equivalent data model using JPA?
note: We don't have any experience with ruby
...