|
Lines 27-32
Link Here
|
| 27 |
* - 249037: JPA 2.0 persisting list item index |
27 |
* - 249037: JPA 2.0 persisting list item index |
| 28 |
* 02/18/2010-2.0.2 Guy Pelletier |
28 |
* 02/18/2010-2.0.2 Guy Pelletier |
| 29 |
* - 294803: @Column(updatable=false) has no effect on @Basic mappings |
29 |
* - 294803: @Column(updatable=false) has no effect on @Basic mappings |
|
|
30 |
* 06/18/2010-2.2 Guy Pelletier |
| 31 |
* - 300458: EclispeLink should throw a more specific exception than NPE |
| 30 |
******************************************************************************/ |
32 |
******************************************************************************/ |
| 31 |
package org.eclipse.persistence.testing.tests.jpa.inherited; |
33 |
package org.eclipse.persistence.testing.tests.jpa.inherited; |
| 32 |
|
34 |
|
|
Lines 62-67
Link Here
|
| 62 |
import org.eclipse.persistence.testing.models.jpa.inherited.Heineken; |
64 |
import org.eclipse.persistence.testing.models.jpa.inherited.Heineken; |
| 63 |
import org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager; |
65 |
import org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager; |
| 64 |
import org.eclipse.persistence.testing.models.jpa.inherited.Location; |
66 |
import org.eclipse.persistence.testing.models.jpa.inherited.Location; |
|
|
67 |
import org.eclipse.persistence.testing.models.jpa.inherited.NoiseBylaw; |
| 65 |
import org.eclipse.persistence.testing.models.jpa.inherited.NoviceBeerConsumer; |
68 |
import org.eclipse.persistence.testing.models.jpa.inherited.NoviceBeerConsumer; |
| 66 |
import org.eclipse.persistence.testing.models.jpa.inherited.Official; |
69 |
import org.eclipse.persistence.testing.models.jpa.inherited.Official; |
| 67 |
import org.eclipse.persistence.testing.models.jpa.inherited.OfficialEntry; |
70 |
import org.eclipse.persistence.testing.models.jpa.inherited.OfficialEntry; |
|
Lines 137-142
Link Here
|
| 137 |
suite.addTest(new InheritedModelJunitTest("testColumnUpdatableAndInsertable")); |
140 |
suite.addTest(new InheritedModelJunitTest("testColumnUpdatableAndInsertable")); |
| 138 |
suite.addTest(new InheritedModelJunitTest("testColumnUpdatableAndInsertableThroughQuery")); |
141 |
suite.addTest(new InheritedModelJunitTest("testColumnUpdatableAndInsertableThroughQuery")); |
| 139 |
suite.addTest(new InheritedModelJunitTest("testElementCollectionMapEmbeddable")); |
142 |
suite.addTest(new InheritedModelJunitTest("testElementCollectionMapEmbeddable")); |
|
|
143 |
suite.addTest(new InheritedModelJunitTest("testMultipleIdButNonIdClassEntity")); |
| 140 |
|
144 |
|
| 141 |
return suite; |
145 |
return suite; |
| 142 |
} |
146 |
} |
|
Lines 149-154
Link Here
|
| 149 |
clearCache(); |
153 |
clearCache(); |
| 150 |
} |
154 |
} |
| 151 |
|
155 |
|
|
|
156 |
public void testMultipleIdButNonIdClassEntity() { |
| 157 |
EntityManager em = createEntityManager(); |
| 158 |
beginTransaction(em); |
| 159 |
|
| 160 |
NoiseBylaw noiseBylaw = new NoiseBylaw(); |
| 161 |
int noiseBylawId = 0; |
| 162 |
|
| 163 |
try { |
| 164 |
getServerSession().setLogLevel(0); |
| 165 |
|
| 166 |
noiseBylaw.setCity("Ottawa"); |
| 167 |
noiseBylaw.setDescription("Can't mow your grass after 9PM!"); |
| 168 |
em.persist(noiseBylaw); |
| 169 |
noiseBylawId = noiseBylaw.getNumber(); |
| 170 |
commitTransaction(em); |
| 171 |
} catch (RuntimeException e) { |
| 172 |
if (isTransactionActive(em)){ |
| 173 |
rollbackTransaction(em); |
| 174 |
} |
| 175 |
|
| 176 |
closeEntityManager(em); |
| 177 |
fail("An exception was caught during create operation: [" + e.getMessage() + "]"); |
| 178 |
} |
| 179 |
|
| 180 |
closeEntityManager(em); |
| 181 |
|
| 182 |
clearCache(); |
| 183 |
em = createEntityManager(); |
| 184 |
|
| 185 |
// find by object entity will not work since there is no IdClass in |
| 186 |
// this case so we will look it up through jpql |
| 187 |
String jpqlString = "SELECT n FROM NoiseBylaw n WHERE n.number =" + noiseBylawId; |
| 188 |
NoiseBylaw refreshedNoiseBylaw = (NoiseBylaw) em.createQuery(jpqlString).getSingleResult(); |
| 189 |
|
| 190 |
//Object refreshedNoiseBylaw = em.createNativeQuery("select * from JPA_NOISY e where e.numb = " + noiseBylawId).getSingleResult(); |
| 191 |
//NoiseBylaw refreshedNoiseBylaw = em.find(NoiseBylaw.class, noiseBylawId); |
| 192 |
assertTrue("The noise bylaw read back did not match the original", getServerSession().compareObjects(noiseBylaw, refreshedNoiseBylaw)); |
| 193 |
|
| 194 |
closeEntityManager(em); |
| 195 |
} |
| 196 |
|
| 152 |
public void testBecksBeerConsumer() { |
197 |
public void testBecksBeerConsumer() { |
| 153 |
EntityManager em = createEntityManager(); |
198 |
EntityManager em = createEntityManager(); |
| 154 |
beginTransaction(em); |
199 |
beginTransaction(em); |