cancel
Showing results for 
Search instead for 
Did you mean: 

EJB3 Entity based Java Dictionary

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

sabine_heider
Explorer
0 Kudos

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

Former Member
0 Kudos

Hi Sabine,

Thanks by response.

Isaias Barroso

Answers (0)