database « Entity « JPA Q&A





1. Elegant ways to handle database views on hibernate entities?    stackoverflow.com

One of the main reasons I use Hibernate is that it provides the flexibility to switch to another database without having to rewrite any code. But until now I did not ...

2. Derby database don't save entity after application running    stackoverflow.com

I'm using Embedded Derby DB with hibernate. I'm saving some entities to database. After shutting down the application there is no entities in DB. Why it could be so? Below my ...

3. JPA - create-if-not-exists entity?    stackoverflow.com

I have several mapped objects in my JPA / Hibernate application. On the network I receive packets that represent updates to these objects, or may in fact represent new objects entirely. ...

4. 2 Hibernate entities on the same database table. Is this possible?    stackoverflow.com

I am working on a modular Webproject with default functionality that can be extended using a "plugin" which is an additional java library. The "core" project knows a User entity that is ...

5. Java JPA: Performant check if Entity is already in DB    stackoverflow.com

What is the best way / best practice to check if an entity is already in a database using JPA? I am writing a client that adds hostinformation to a db. For ...

6. Is it possible to detach Hibernate entity, so that changes to object are not automatically saved to database?    stackoverflow.com

I have Hibernate entity that I have to convert to JSON, and I have to translate some values in entity, but when I translate values, these values are instantly saved to ...

7. Unable to save the entity in database    stackoverflow.com

I am using jpa .I am using @Service annotation over my service and @Transactional annotation over a method for saving some entity.But when i am calling method jpa giving an ...

8. Persisting Entities to a Database Java    stackoverflow.com

I'm just starting to work with persistence and databases in my use of webapps. I have created several Entity classes and have a database connection set up in Eclipse, but I'm ...

9. Persisting new Entity to existing Database JPA    stackoverflow.com

I've created a database connection and some entities, now I'm trying to test the functionality of my database. I have a User entity class, which has a unique username along with ...





10. What's the best way to keep bad words into database entity?    stackoverflow.com

I have some web application for placement on external sites. This application is a widget for comments like disqus (disqus.com). In application each widget it's a entity object with a lot of ...

11. What's the best way to keep status of comment object?    stackoverflow.com

I have some web application for placement on external sites. This application is a widget for comments like disqus (disqus.com). Each comment it's a entity object with fields: "author", "body", "time" and ...

12. JPA entity from DB NB 6.7 RC3    forums.netbeans.org

Hi, When I generate entities from database there is no default constructor in primary key's classes. How can I solved this problem or maybe this is a bug in RC3. This ...

13. JPA entity from DB - NB 6.7 RC3    forums.netbeans.org

14. Hibernate - Updating a newly created entity... that's in memory, not in db yet.    coderanch.com

So wondering if this is even possible... Setup: Member Entity Address Entity OneToMany @Jointable -> MemberAddress (magically updated) (I'm using annotations and spring, no cfg.xml files) 'Enhancement': MemberAddress is also an Entity because I have add'l fields in it. Issue: Just after I create the Member with Address data in it (which, as mentioned earlier, automagically inserts the MemberAddress record), I ...

15. Entity not persisting into Database after persist()    forum.hibernate.org

Hi, I'm trying to setup my generic JPA DAO which seems to be working fine it does get primary key value and throws no exception. However, in the log I don't find any SQL INSERT statement and also the record is not being inserted. persist method from generic dao: Code: @Transactional(propagation = Propagation.REQUIRED) public void ...

16. problem retrieving specific entities from the DB    forum.hibernate.org

Thanks in Advance, I have a simple one to many relationship between a material issue and material issue details tables mapped into POJOs with hibernate into Issue and IssueDetails Classes. When i execute the query given below, for some dates i am encountering the following exception where hibernate is not able to retrieve records associated with specific issue numbers. I check ...





17. pre-updateEventListener and DB changes to entities    forum.hibernate.org

I am having the same problem. I am able to edit a new entity being saved using a PostInsertEventListener. But using similar code in a PostUpdateEventListener does nothing. Can anyone help? Here is what I am trying to do: Code: public class ClientSaveEventListener implements PostInsertEventListener, PostUpdateEventListener { public ClientSaveEventListener() { ...

18. Different databases, same entities    forum.hibernate.org

Hello! Here is the situation I have: There are multiple legacy SQL Server databases with exactly the same structure. Each database holds data for a specific customer and this is how it's gonna be due to business requirements. So, what I wanna do is, when user tries to log in, he/she should provide also the database name along with his/her credentials. ...

19. Two databases in one entity    forum.hibernate.org

21. How to copy an entity to a different table (or database)?    forum.hibernate.org

(Note: this is a cross post from another topic) Hi, Suppose I have a table CustomerAccounts and an associated table Invoices in a database called Northwind_CA. Using Hibernate, I have an entity class called CustomerAccount, which reference another entity class called Invoice. So far so good. However, I want to do two things: 1. Copy an entity from CustomerAccounts to a ...