Lines 19-24
Link Here
|
19 |
import org.eclipse.persistence.descriptors.RelationalDescriptor; |
19 |
import org.eclipse.persistence.descriptors.RelationalDescriptor; |
20 |
import org.eclipse.persistence.internal.helper.*; |
20 |
import org.eclipse.persistence.internal.helper.*; |
21 |
import org.eclipse.persistence.sessions.*; |
21 |
import org.eclipse.persistence.sessions.*; |
|
|
22 |
import org.eclipse.persistence.internal.sessions.DatabaseSessionImpl; |
22 |
import org.eclipse.persistence.expressions.*; |
23 |
import org.eclipse.persistence.expressions.*; |
23 |
|
24 |
|
24 |
public class Employee1 implements Serializable { |
25 |
public class Employee1 implements Serializable { |
Lines 55-73
Link Here
|
55 |
/** |
56 |
/** |
56 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
57 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
57 |
*/ |
58 |
*/ |
58 |
public static void amendEmployee1WithFKInfo(DatabaseSession session) { |
59 |
public static void amendEmployee1WithFKInfo(DatabaseSessionImpl session) { |
59 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
60 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
60 |
|
|
|
61 |
amendEmployee1WithFKInfo(descriptor); |
61 |
amendEmployee1WithFKInfo(descriptor); |
62 |
|
|
|
63 |
// Insert new descriptor. |
62 |
// Insert new descriptor. |
64 |
session.addDescriptor(descriptor); |
63 |
session.addDescriptor(descriptor); |
|
|
64 |
session.initializeDescriptors(); |
65 |
} |
65 |
} |
66 |
|
66 |
|
67 |
/** |
67 |
/** |
68 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
68 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
69 |
*/ |
69 |
*/ |
70 |
public static void amendEmployee1WithJoinOnly(DatabaseSession aSession) { |
70 |
public static void amendEmployee1WithJoinOnly(DatabaseSessionImpl aSession) { |
71 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
71 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
72 |
|
72 |
|
73 |
// Setup the join from the employee table to the address table using a custom join expression and |
73 |
// Setup the join from the employee table to the address table using a custom join expression and |
Lines 77-82
Link Here
|
77 |
|
77 |
|
78 |
// Insert new descriptor. |
78 |
// Insert new descriptor. |
79 |
aSession.addDescriptor(descriptor); |
79 |
aSession.addDescriptor(descriptor); |
|
|
80 |
aSession.initializeDescriptors(); |
80 |
} |
81 |
} |
81 |
|
82 |
|
82 |
/** |
83 |
/** |
Lines 98-110
Link Here
|
98 |
/** |
99 |
/** |
99 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
100 |
* Amend the Employee1 descriptor with a join expression to join the multiple tables in the database. |
100 |
*/ |
101 |
*/ |
101 |
public static void amendEmployee1WithJoinWithInsert(DatabaseSession aSession) { |
102 |
public static void amendEmployee1WithJoinWithInsert(DatabaseSessionImpl aSession) { |
102 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
103 |
ClassDescriptor descriptor = (ClassDescriptor)new LegacyTestProject().getDescriptors().get(Employee1.class); |
103 |
|
104 |
|
104 |
amendEmployee1WithJoinWithInsert(descriptor); |
105 |
amendEmployee1WithJoinWithInsert(descriptor); |
105 |
|
106 |
|
106 |
// Insert new descriptor. |
107 |
// Insert new descriptor. |
107 |
aSession.addDescriptor(descriptor); |
108 |
aSession.addDescriptor(descriptor); |
|
|
109 |
aSession.initializeDescriptors(); |
108 |
} |
110 |
} |
109 |
|
111 |
|
110 |
public static Employee1 example1() { |
112 |
public static Employee1 example1() { |