Assuming two different schemas on the same server, you should be able to do this using the @SecondaryTable annotation which allows you to map one entity to 2 or more tables. The annotation allows you to specify to the schema or catalog containing the secondary table.
https://docs.oracle.com/javaee/5/api/index.html?javax/persistence/SecondaryTable.html
Would look something like:
@Entity
@Table(name = "main_table")
@SecondaryTable(name="secondary_table", schema="secondary_schema")
public class MyEntity{
@Column(name = "my_field", table="secondary_table")
private String fieldFromSecondaryTable;
}
If you are talking about two different servers then you can look at doing something at the database level which would allow you to create a DB view and then map an entity to this view. This would work for read operations but not sure about writing...
In SQL Server, for example, you would be looking at creating a Linked Server:
Selecting data from two different servers in SQL Server