Hi,
I am developing a stand-alone java client application that connects to a Glassfish v3 application for JPA/EJB facade style transactions. In other words, my client application do not connect directly to the database to CRUD, but it transfers JPA objets using EJB stateless sessions.
I have scenarios where this client application will...
Hello,
I am working with JPA and I would like to persist an object (Action) composed of an object (Domain).
There is the Action class code:
@Entity(name="action")
@Table(name="action")
public class Action {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="num")
private int num;
@OneToOne(cascade= { Casca...
Hi,
I'm working for a Swing Project and the technologies used are netbeans with Toplink essentials, mysql.
The Problem I'm facing is the entity object dosn't get updated after insertions take place while calling a getter collection of the foreign key property.
Ex: I have 2 tables Table1,Table2. I have sno column, id column as a prim...
Hello,
I have a method annotated with @PrePersist annotation but I've seen that when this method is executed all my transient attributes (the attributes with the @Transient annotation) are null.
When I debug the applicaion I can see that this transient attributes are not null just before calling the persist() method and when it enters...
I want to build a method that can both retrieve a count(*) and select * from a criteria query. Using the hibernate criteria API I could easily do this using
criteria.setProjection(Projections.rowCount());
, but I recently started using the JPA2.0 Criteria API and am uncertain how to obtain a similar result. Below is a little code frag...
Which Java ORM is considered the most performant generally speaking?
I realize this could mean less features, but just want an idea.
...
Hello,
I have an attribute which is annotated with @Id. The ID is going to be generated automatically when persisting the object. That means that the ID-value is not defined before I persist the object. After persisting it, it has an ID (in the database), but unfortunately the field still remains null as long as I don't reload it from t...
I'm trying the following JPQL and it fails misserably:
Query query = em.createQuery("SELECT u FROM User u WHERE 'admin' MEMBER OF u.roles");
List users = query.query.getResultList();
I get the following exception:
ERROR [main] PARSER.error(454) | <AST>:0:0: unexpected end of subtree
java.lang.IllegalArgumentException: org.hibernate....
i've three entity classes in my project
public class Blobx {
@ManyToOne
private Userx user;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key id;
}
public class Index {
@Id
private String keyword;
@OneToMany(cascade = CascadeType.PERSIST)
private List<Blobx> blobs;
}
public class Userx {
@Id
private String name; ...
I have two tables: t_promo_program and t_promo_program_param.
They are represented by the following JPA entities:
@Entity
@Table(name = "t_promo_program")
public class PromoProgram {
@Id
@Column(name = "promo_program_id")
private Long id;
@OneToMany(cascade = {CascadeType.REMOVE})
@JoinColumn(name = "promo_program_id")
pri...
Have been trying the whole day long and googled the ** out of the web ... in vain. You are my last hope:
Here's my code:
The Entity:
package sas.test.model;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity
public class Employee {
@Id private int id;
private String name;
private long salary;
publi...
In my code I am using JSF - Front end , EJB-Middile Tier and JPA connect to DB.Calling the EJB using the Webservices.Using MySQL as DAtabase.
I have created the Voter table in which I need to insert the record.
I ma passing the values from the JSF to EJB, it is working.I have created JPA controller class (which automatcally generates the...
I'm trying to learn about grails with Google App Engine and JPA by following a few tutorials:
http://www.morkeleb.com/2009/08/12/grails-and-google-appengine-beginners-guide/
http://inhouse32.appspot.com/index.html
http://grails.org/plugin/app-engine
I've got grails 1.3.0 RC 2, and App Engine SDK 1.3.3, and I'm using Windows 7. The st...
I am trying to execute the following JPA query:
public static final String UPDATE_INVENTORY_CUSTOMER_FOR_AMS_MAPPING = "UPDATE Inventory inventory SET"
+ " inventory.customer.id = :" + DataAccessConstants.PARAM_CUSTOMER_ID
+ " ,inventory.lastUpdateUserId = :" + DataAccessConstants.PARAM_USER_ID
+ " where inventory.amsCo...
I'm trying to impose a @Oneto7 association. I'd have imagined an attribute that specifies the target many value, but have found none.
If there is no such attribute, how else, in JPA/EclipseLink would one achieve it?
...
I understand that this is highly specific to the concrete application, but I'm just wondering what's the general opinion, or at least some personal experiences on the issue.
I have an aversion towards the 'open session in view' pattern, so to avoid it, I'm thinking about simply fetching everything small eagerly, and using queries in the...
Hello,
I am trying to figure out this error since 5 hours without any success. SO i finally thought of posting in here. Please help i am really in big trouble. I am stuck on this and see no way of solving this error. This is my database structure
tblBlogRegion
BlogRegionId (primary key)
...
I'm trying to add constraints checking, as described here http://stackoverflow.com/questions/2705759/how-to-specify-the-cardinality-of-a-onetomany-in-eclipselink-jpa
...
Hello,
I add entity to my database and it works fine. But when i retrieve the List, i get the old entity, the new entities i add are not shown until i undeploy the application and redeploy it again. This means are my entities cached by default? But, I haven't made any settings for caching entities in my persistence.xml or any such file.
...
I know how to table in google BigTable.I have one doubt regarding this.what are all the datatype supported by google BigTable.
Thanks in advance
...