on 08-14-2007 6:21 PM
Hi all,
How to developer a Entity (EJB3) based a Java Dictionary instead to access table directly?
If i do a mapping like this, i will access table EMPLOYEE
@Entity
public class Employee{
@Id
private int id;
private String name;
}
Thanks
Hi Isaias,
You have to distinguish between the design time integration of EJB3/JPA and Java Dictionary on the one hand and the runtime integration on the other.
Currently, there is no design time integration between JPA and Java Dictionary. That means it is not yet possible to validate an entity (i.e. to check the existence of tables and columns) against a Java Dictionary project rather than a particular database. This will change with NW CE 7.1 SP3 when we deliver the missing integration as part of an improved JPA tool set.
At runtime, however, the integration is already available so that JPA can work with the tables created by the Java Dictionary. To do so, your application should deploy a data source alias that points to the system data source (see <a href="http://help.sap.com/saphelp_nwce10/helpdata/en/45/c82cd460a42e96e10000000a155369/frameset.htm">Deploying DataSource Aliases</a>) and refer to this data source alias in the persistence.xml file. See <a href="http://help.sap.com/saphelp_nwce10/helpdata/en/45/c8baeb5f0c2e97e10000000a155369/frameset.htm">Running JPA Applications on the System DataSource</a> for details.
Change the mapping of your entity so that it matches the definition of the table, e.g. in your example (provided there is a table TMP_EMPLOYEE), add a corresponding @Table annotation:
@Entity
@Table(name = "TMP_EMPLOYEE")
public class Employee {
...
}
Hope that helps.
Best regards,
Sabine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.