Hi I am new to Java persistence.
Does it matter where I put the Annotations at?
Are the following two sets of the code the same?
Thanks a lot!!
@Entity
@Table(name="user", schema="billing")
public class User {
private long id ;
private String userName ;
private String password ;
@Id
@GeneratedValue
public lon...
I’m new to object oriented database designs and I’m trying to understand how I should be structuring my classes in JDO for google app engine, particularly one to many relationships.
Let’s say I’m building a structure for a department store where there are many departments, and each department has many products. So I’d want to have a cla...
Is it possible to setup HSQLDB in a way, so that the files with the db information are written into memory instead of using actual files? I want to use hsqldb to export some data structures together with hibernate mappings. Is is, however, not possible to write temporary files, so that I need to generate the files in-memory and return a ...
For a project I am working on, I need to persist a number of POJOs to a database. The POJOs class definitions are sometimes highly nested, but they should flatten okay, as the nesting is tree-like and contains no cycles (and the base elements are eventually primitives/Strings). It is preferred that the solution used create one table per ...
My application users asked if it were possible for pages that contain a jqGrid to remember the filter, sort order and current page of the grid (because when they click a grid item to carry out a task and then go back to it they'd like it to be "as they left it")
Cookies seem to be the way forward, but how to get the page to load these a...
I need to have two activities in an Android app that can be switched between each other with UI persistence as follows:
Activity A launches Activity B.
User triggers some UI changes in Activity B.
Activity B returns to Activity A (by a call to onBackPressed() or something similar)
Activity A re-launches Activity B.
I would like the c...
Fellow StackOverflowers, is there a way for me to remove a queue or a topic in ActiveMQ programatically? I am using ActiveMQ's standard persistency, and my application requires that, on startup, all new queues be dynamically re-created (unless there are messages stored in the queue, in which case, the queue should remain to exist).
I am...
Hello,
I'm trying to migrate my app from PHP and RDBMS (MySQL) to Google App Engine and have a hard time figuring out data model and relationships in JDO. In my current app I use a lot of JOIN queries like:
SELECT users.name, comments.comment
FROM users, comments
WHERE users.user_id = comments.user_id
AND users.email = '[email protected]...
I am in the process of unit testing a DAO built with Spring/JPA and Hibernate as the provider.
Prior to running the test, DBUnit inserted a User record with username "poweruser" -- username is the primary key in the users table. Here is the integration test method:
@Test
@ExpectedException(EntityExistsException.class)
public void save...
I have ran into an issue with my SQL instance store attached to a WorkflowApplication that is running. When I exit my application I'm calling an Unload() on the WF app to persist it. I didn't think about it during design time, but it does makes sense, it's persisting an arg that was passed in to the WorkflowApplication constructor when i...
Using this MSDN Article as an example for pausing and resuming, one would assume that this would be pretty straight forward. This is how I'm "pausing" the workflow...
LastWfGuid = workflow.Id;
workflow.Unload();
Pretty simple, it's supposed to persist to the instance store (which I already set prior to these two lines) and I do see en...
I've got an app which dynamically generates anywhere from 6 to 100 small bitmaps for the user to move around the screen in a given session. I currently generate them in onCreate and store them to the sd card, so that after an orientation change I can grab them out of external storage and display them again. However, this takes time (th...
I would like to know as to what will happen to the thread which has been created by an activity and the device is rotated. I have observed that the onDestroy method is called when this happens. Will the thread be killed too?
If the thread is not killed, how can I reassociate the thread with the activity as a new instance of the activity...
I have a int which is my high score:
NSInteger highScore;
I want to store it persistently to disk
Do I have to convert it to a string, then write the string to a file, then parse it back when I want to read it. Or is there a better way to store small amounts of data?
...
I have a java web app that makes back-end use of a third-party web service. Calling the web service creates latency, which is important to avoid whenever possible. Also, my app is only allowed to make a certain number of web service calls per day, so it's best not to make a web service call unless absolutely needed.
My current solutio...
Sadly, I forgot to take the code from work with me today. But maybe this little example will clarify things.
I use hibernate to map a bean to a table.
Example:
import javax.persistence.column;
….
String columnameA;
….
@Column(name="columnameA")
public String getColumname(){
return columnameA
}
….
I do not want to hardcode the colu...
I need to add a cache to my Java app, and I'm considering using JCS.
The last JCS release was done in June 2009. Is JCS still being maintained, or has the project been abandoned?
I realize that anyone can look at the svn checkin log for JCS. What I would ideally like is an answer from someone who is a JCS committer, or who is directl...
I've seen (and done) data source configuration in two ways (the code below is just for demo):
1) configuration inside persistence units, like:
<persistence-unit name="LocalDB" transaction-type="RESOURCE_LOCAL">
<class>domain.User</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<proper...
I am using Java EE 6. Just want to throw it out there first
Here is the relationship. A customer can have multiple facility
Here is Customer Class
@Entity
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
@OneToMany(cascade=CascadeType.ALL)
@Jo...
If a regular internet user wishes to contact a TCP service on their computer but without having to go through the hassle of firewall translation I think I'm right in saying that the 'best' way to do this is by having a 3rd party in the middle that will accept connections from both the user's home computer and their travelling computer an...