Questions tagged [entitymanager]

The EntityManager is the representation of a PersistenceContext, allowing a user to manipulate data pulled from a database.

1802 questions
0
votes
2 answers

Need to use Symfony Console Command to accept input and access the data from database

As per the documentation on the symfony, i have created the console file in /bin folder !/usr/bin/env php date_default_timezone_set('UTC'); set_time_limit(0); (@include_once DIR . '/../vendor/autoload.php') || @include_once DIR .…
0
votes
1 answer

How to check if there's no change in a database?

I have a short question about EntityManager. I have a method updateAdmin(Admin a). Behaviour: This method should update an existing Admin in my database. Return true if an admin exist an the update was successful. Return false if the Admin that has…
Momo Saibak
  • 37
  • 1
  • 9
0
votes
0 answers

Injection of EntityManager in JSF

I am using injections but I have some problems : HTTP Status 500 - javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is: type Exception report message javax.ejb.EJBException: The bean encountered a…
davyd
  • 13
  • 6
0
votes
0 answers

create multiple entityManager from entityManagerFactory

When i used one entityManager for one entityManagerFactory everything work now i'm trying multiple EntityManager for one entityManagerFactory I have several scheme (Instance) of my database. With only 1 entityManagerFactory i'm trying to create…
tamtoum1987
  • 1,957
  • 3
  • 27
  • 56
0
votes
1 answer

Update database when some entries were removed JPA

I'm developing a logic in the server side of my project that will update an Entity in the database. But this entity has reference to a list of another entity. So, for example I have an Entity Test like this one: @Entity public class Test { …
Felipe Mosso
  • 3,907
  • 11
  • 38
  • 61
0
votes
1 answer

Hibernate Criteria ManyToMany selection

I have two classes Student and Class in @ManyToMany relationship. I would like to select all classes in which student (id = 1) is not. How can I do it?
Amsik
  • 698
  • 2
  • 6
  • 26
0
votes
0 answers

Unable to build entity manager

My persistence.xml
Mirza
  • 33
  • 5
0
votes
1 answer

Test EntityManager using JUnit Mockito

I am using Junit with Mockito. I want to test EntityManager, i am getting java.lang.NullPointerException The below is what i have tried, main class method is, @Override public ReplicationPerspective buildReplicationPerspective(final String…
Arasu
  • 2,078
  • 6
  • 40
  • 67
0
votes
1 answer

No transactional EntityManager available;

My app using spring and jpa, i have two config file: AppConfig: @Configuration @EnableTransactionManagement @ComponentScan(basePackages = { "com.test.api"…
namtn
  • 71
  • 1
  • 6
0
votes
2 answers

Transactions and detach objects JPA

Good morning in my timezone. Technologies : EJB 3.0 JPA provider ->(openjpa) Container -> WAS SNIPPET OF CODE: @Stateless(name = "ejb/BeanName") public class A implements AInterface{ @PersistenceContext(unitName =…
tt0686
  • 1,771
  • 6
  • 31
  • 60
0
votes
1 answer

Null Pointer Exception while trying to Update or Delete any item using openJPA

I am getting below Exception while I try to Update or Delete any item from database using openJPA: Caused by: java.lang.NullPointerException at org.apache.openjpa.kernel.StateManagerImpl.replaceObjectField(StateManagerImpl.java:2076) at…
JavaJo
  • 15
  • 10
0
votes
1 answer

Cannot acquire data source whit PostgreSql. Can't use JPA EntityManager

I have the next problem: I am doing a project using JPA and Restfull whit netbeasn and postgres, I have the following persistence
0
votes
1 answer

EntityManager merge() in JPA

I'm working on an application that manages two tables in a database with JPA. The first one contains Users and the second one Items; one user can have many items but an item only corresponds to one user. This means that theres is a One to Many…
JsMartinez
  • 321
  • 1
  • 5
  • 16
0
votes
2 answers

JPA EntityManager Nullpointer exception (which shouldn't be!?)

My ejb code: @Stateless public class EmployeeBean { @PersistenceContext(unitName="Eclipselink_JPA") private EntityManager entitymanager; public void createEmployee(){ Employee employee = new Employee( ); …
0
votes
2 answers

Retrieve specific table rows using Java Persistence

I have a table patient_details(patient_id, first_name, last_name, address,date_of_birth, gender, contact_number,occupation). I have generated an entity class and a PersistenceUnit. I can only find an object using its ID: PatientDetails pd =…
1fuyouinfinite
  • 1
  • 1
  • 1
  • 14
1 2 3
99
100