|
Lines 3222-3229
Link Here
|
| 3222 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
3222 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
| 3223 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
3223 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
| 3224 |
Type keyType = anAttribute.getKeyType(); |
3224 |
Type keyType = anAttribute.getKeyType(); |
| 3225 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
3225 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 3226 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
3226 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 3227 |
assertNotNull(keyType); |
3227 |
assertNotNull(keyType); |
| 3228 |
assertTrue(keyType instanceof Type); |
3228 |
assertTrue(keyType instanceof Type); |
| 3229 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
3229 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 3290-3297
Link Here
|
| 3290 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
3290 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
| 3291 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
3291 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
| 3292 |
Type keyType = anAttribute.getKeyType(); |
3292 |
Type keyType = anAttribute.getKeyType(); |
| 3293 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
3293 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 3294 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
3294 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 3295 |
assertNotNull(keyType); |
3295 |
assertNotNull(keyType); |
| 3296 |
assertTrue(keyType instanceof Type); |
3296 |
assertTrue(keyType instanceof Type); |
| 3297 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
3297 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4241-4248
Link Here
|
| 4241 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
4241 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
| 4242 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
4242 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
| 4243 |
Type keyType = anAttribute.getKeyType(); |
4243 |
Type keyType = anAttribute.getKeyType(); |
| 4244 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4244 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4245 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4245 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4246 |
assertNotNull(keyType); |
4246 |
assertNotNull(keyType); |
| 4247 |
assertTrue(keyType instanceof Type); |
4247 |
assertTrue(keyType instanceof Type); |
| 4248 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4248 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4283-4290
Link Here
|
| 4283 |
//@OneToMany(cascade=ALL, mappedBy="mappedEmployerUC1a") |
4283 |
//@OneToMany(cascade=ALL, mappedBy="mappedEmployerUC1a") |
| 4284 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC1a; |
4284 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC1a; |
| 4285 |
Type keyType = anAttribute.getKeyType(); |
4285 |
Type keyType = anAttribute.getKeyType(); |
| 4286 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4286 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4287 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4287 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4288 |
assertNotNull(keyType); |
4288 |
assertNotNull(keyType); |
| 4289 |
assertTrue(keyType instanceof Type); |
4289 |
assertTrue(keyType instanceof Type); |
| 4290 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4290 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4412-4419
Link Here
|
| 4412 |
// Same as UC1a - that is missing the @MapKey |
4412 |
// Same as UC1a - that is missing the @MapKey |
| 4413 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC7; |
4413 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC7; |
| 4414 |
Type keyType = anAttribute.getKeyType(); |
4414 |
Type keyType = anAttribute.getKeyType(); |
| 4415 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4415 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4416 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4416 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4417 |
assertNotNull(keyType); |
4417 |
assertNotNull(keyType); |
| 4418 |
assertTrue(keyType instanceof Type); |
4418 |
assertTrue(keyType instanceof Type); |
| 4419 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4419 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4455-4462
Link Here
|
| 4455 |
// Same as UC1a - that is missing the @MapKey name attribute |
4455 |
// Same as UC1a - that is missing the @MapKey name attribute |
| 4456 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC8; |
4456 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC8; |
| 4457 |
Type keyType = anAttribute.getKeyType(); |
4457 |
Type keyType = anAttribute.getKeyType(); |
| 4458 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4458 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4459 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present or missing name attribute - we default to the PK |
4459 |
assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4460 |
assertNotNull(keyType); |
4460 |
assertNotNull(keyType); |
| 4461 |
assertTrue(keyType instanceof Type); |
4461 |
assertTrue(keyType instanceof Type); |
| 4462 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4462 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4542-4549
Link Here
|
| 4542 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
4542 |
// http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_63:_20090824:_Add_Map_support_for_.40MapKey_to_MapAttribute |
| 4543 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
4543 |
// Key is the primary key (PK) of the target entity - in this case HardwareDesigner which inherits its @Id from the Person @MappedSuperclass as '''Integer'''. |
| 4544 |
Type keyType = anAttribute.getKeyType(); |
4544 |
Type keyType = anAttribute.getKeyType(); |
| 4545 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4545 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4546 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4546 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4547 |
assertNotNull(keyType); |
4547 |
assertNotNull(keyType); |
| 4548 |
assertTrue(keyType instanceof Type); |
4548 |
assertTrue(keyType instanceof Type); |
| 4549 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4549 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4585-4592
Link Here
|
| 4585 |
//@OneToMany(cascade=ALL, mappedBy="mappedEmployerUC1a") |
4585 |
//@OneToMany(cascade=ALL, mappedBy="mappedEmployerUC1a") |
| 4586 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC1a; |
4586 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC1a; |
| 4587 |
Type keyType = anAttribute.getKeyType(); |
4587 |
Type keyType = anAttribute.getKeyType(); |
| 4588 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4588 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4589 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4589 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4590 |
assertNotNull(keyType); |
4590 |
assertNotNull(keyType); |
| 4591 |
assertTrue(keyType instanceof Type); |
4591 |
assertTrue(keyType instanceof Type); |
| 4592 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4592 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
|
Lines 4674-4681
Link Here
|
| 4674 |
assertNotNull(keyType); |
4674 |
assertNotNull(keyType); |
| 4675 |
assertTrue(keyType instanceof Type); |
4675 |
assertTrue(keyType instanceof Type); |
| 4676 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4676 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
| 4677 |
|
|
|
| 4678 |
|
| 4679 |
} catch (IllegalArgumentException iae) { |
4677 |
} catch (IllegalArgumentException iae) { |
| 4680 |
//iae.printStackTrace(); |
4678 |
//iae.printStackTrace(); |
| 4681 |
exceptionThrown = true; |
4679 |
exceptionThrown = true; |
|
Lines 4713-4725
Link Here
|
| 4713 |
// Same as UC1a - that is missing the @MapKey |
4711 |
// Same as UC1a - that is missing the @MapKey |
| 4714 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC7; |
4712 |
//private Map<String, HardwareDesigner> hardwareDesignersMapUC7; |
| 4715 |
Type keyType = anAttribute.getKeyType(); |
4713 |
Type keyType = anAttribute.getKeyType(); |
| 4716 |
//assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present |
4714 |
assertEquals(String.class, keyJavaType); // When @MapKey(name="name") is present - or generics are set |
| 4717 |
assertEquals(Integer.class, keyJavaType); // When @MapKey is not present - we default to the PK |
4715 |
//assertEquals(Integer.class, keyJavaType); // When @MapKey or generics are not present - we default to the PK |
| 4718 |
assertNotNull(keyType); |
4716 |
assertNotNull(keyType); |
| 4719 |
assertTrue(keyType instanceof Type); |
4717 |
assertTrue(keyType instanceof Type); |
| 4720 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
4718 |
assertEquals(Type.PersistenceType.BASIC, keyType.getPersistenceType()); |
| 4721 |
|
|
|
| 4722 |
|
| 4723 |
} catch (IllegalArgumentException iae) { |
4719 |
} catch (IllegalArgumentException iae) { |
| 4724 |
//iae.printStackTrace(); |
4720 |
//iae.printStackTrace(); |
| 4725 |
exceptionThrown = true; |
4721 |
exceptionThrown = true; |