Reputation: 15
Is there any way to use JPA just for insert, update, delete and select but not to change tables? I have made a reverse engineering and made java classes from database tables... In this class I have @Entity and @Id annotations, but I don't need to create entities or fields in the database. I have a finished database schema and there is a DB Admin who is responsible for all tables and fields. Is there any way to do this?
Upvotes: 0
Views: 273
Reputation: 1382
It is up to the developer whether to create new entities (rows in a table). There is no specific ORM technology for the above scenarios. Creating tables in a database is an additional feature provided by the most of the technologies, providing entities. In this case, you can create respective entity object from the database (as you already have the database) and then insert a new row, update, delete and free to do what ever you want.
Thanks, JK
Upvotes: 0
Reputation: 65
You can create an EntityManagerFactory object to realize your operations(insert, delete......) and call your functions in main. It need you to import javax.persistence.*
Upvotes: 2
Reputation: 1357
I think you mean that you don't want to create/modify any table... Turn off ddl schema generation in persistence.xml
Upvotes: 0