The EntityManager is the representation of a PersistenceContext, allowing a user to manipulate data pulled from a database.
Questions tagged [entitymanager]
1802 questions
0
votes
0 answers
Spring defining get multiple entity manager for same datasource
Is it possible to define multiple EntityManager on same datasource in Spring?

Reza Shirin Nezhad
- 115
- 10
0
votes
1 answer
Entity update in EntityManager
Describe briefly the whole situation. I have an entity
public class MovieEntity {
...
@OneToMany(mappedBy = "movie", cascade = CascadeType.ALL)
private Set otherTitles;
...
}
I save a movie in the database using the JPA…
user9007660
0
votes
0 answers
Unable to build entity manager factory - Rest Tomcat Jpa
I'm making a Restful web service using netbeans, tomcat, jpa and jax-rs. I have this error since I've add the tags to my persistence.xml for all of my classes (And I need them to make a select).
The error is :…

MBek
- 155
- 10
0
votes
1 answer
TestNG Listeners: Intercepting @DataProvider
This is a follow up question to this:
TestNG: Identifying which tests methods are next
I realize now that it's possible to intercept test methods. However, it seems that the best time to safely clear the entityManager is before a @DataProvider…

Jan Julian
- 473
- 2
- 4
- 15
0
votes
1 answer
Is javax.persistence.entitymanager is a JPA interface?
Today I've confused. is javax.persistence.entitymanager a JPA interface?
Thanks

qasanov
- 427
- 1
- 7
- 20
0
votes
1 answer
JPA NamedNativeQuery with SqlResultMapping
I have a problem with native query. I have following entity:
@Entity
@NamedNativeQueries({
@NamedNativeQuery(name = ExampleEntity.Q.getTestQuery, query = "SELECT a.name as name FROM ExampleEntity a WHERE a.id = 5", resultSetMapping =…

sentinel
- 41
- 1
- 1
- 7
0
votes
1 answer
How can i get the Database Driver from an existing EntityManager?
In my application, i should know, which database driver i use.
This can be in case to case another. (H2 or Postgres)
Is there a way to check if it's an H2? Because H2 doesn't have the same tables.
cheers
K.Hunn

K. Hunn
- 1
0
votes
1 answer
EntityManager and two DAO with PersistenceContextType.EXTENDED
I have a problem with my entity manager in my application. I have two DAO clasess like this:
@Repository
public abstract class DaoA
{
protected ClassA persistentClass;
@PersistenceContext(name="my.persistence",…

hsd
- 1
- 1
0
votes
1 answer
@Transactional EntityManager in Service Thread with CDI
I have a service in the business tier of a JEE CDI application that needs to perform an intensive work task that needs to be spawned off on a separate thread.
public MyService {
public void doTask( MyDataKey myDataKey ) {
MyThread…

Chris
- 311
- 1
- 2
- 10
0
votes
0 answers
Why entityManager.remove doesn't work?
I have a little problem with a particular case in my project.
I have an entity called SupplierDocument and I would delete a record in it.
In the follow class I call remove method from documentService
@ViewScope
@SpringView(name =…

Gjord83
- 311
- 1
- 5
- 17
0
votes
0 answers
Can't refactor EntityManager in Netbeans
I have a habit of getting into annoying bugs. I have checked forums but nothing seems to work. I accidentally dragged entitymanager (an invisible Swing component) and now I can't get rid of it. I tried the navigation tree to refactor but it throws…

RforResearch
- 401
- 8
- 16
0
votes
1 answer
Transactional+AbstractRoutingDataSource+EntityManager
I have two data sources with different PlatformTransactionManager, LocalContainerEntityManagerFactoryBean
I have RoutingDataSource class which extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource to route right data source…

Alex
- 21
- 3
0
votes
1 answer
multiple entitymanager symfony
Before I used only one entity manager to interact with my database.
Everything worked well till I add 2 new entity manager (one entity manager to insert data and one entity manager to select data)
-> I want to make a replication of my database…

cretthie
- 349
- 1
- 2
- 11
0
votes
1 answer
EntityManager.getResultList() does not return the expected result
select a.AssignAccOwner,a.AssignBillRate,a.AssignPerdiem from orion_db.assignment as a where a.AssignmentId=25
I am able to execute the above query successfully . But when I try to execute the same query programatically using…

Thejas
- 379
- 5
- 24
0
votes
1 answer
ContextNotActiveException while calling entityManger.createNativeQuery using thread
I have started a thread but when it try to access entity Manager it throws exception as
javax.enterprise.context.ContextNotActiveException:
WebBeans context with scope type annotation @RequestScoped does not exist within current thread
How…

AmolG
- 53
- 8