Answer the question
In order to leave comments, you need to log in
How to use EntityManager?
how to pull out all rows from the database (create a sheet) using entitymanager \ and put one there, if I understand the methods correctly, then
@Autowired
private EntityManager entityManager;
public void addUserAccount(ClientOrder clientOrder){
String sql = "Insert into " +
tableName + columns +
"values (" +
clientOrder.getFirstName() + ", " +
clientOrder.getLastName() + ", " +
clientOrder.geteMail() + ", " +
clientOrder.getPassword() + ")";
entityManager.createStoredProcedureQuery(sql);
}
public ArrayList<ClientOrder> findAllOrders(){
String sql = "Select * from " + tableName;
List<ClientOrder> clientOrders = (List<ClientOrder>) entityManager.createQuery(sql);
return (ArrayList<ClientOrder>) clientOrders;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question