I have two tables in the database that have the same layout, however they are not related and each one is independent of the other. I have the entity class below that points to one of the tables. Can I somehow reuse it for the other table, or do I need to replicate the class and point it to the other table?
import javax.persistence.Entity;
import javax.persistence.Column;
...
....
@Entity
@Table(schema = "my_schema", name = "my_table1")
//@Table(schema = "my_schema", name = "my_table2") - note table1 and table2 have the same schema
public class MyTable {
...
...
@Column(name = "my_col1")
String myCol1;
...
...
getters
setters
etc.
}