|
1 | 1 | package com.devonfw.cobigen.templates.devon4j.test.templates.testclasses;
|
2 | 2 |
|
3 |
| -import javax.persistence.*; |
4 |
| -import java.util.List; |
5 |
| - |
| 3 | +import javax.persistence.Column; |
| 4 | +import javax.persistence.Entity; |
| 5 | +import javax.persistence.EnumType; |
| 6 | +import javax.persistence.Enumerated; |
| 7 | +import javax.persistence.Id; |
| 8 | +import javax.persistence.Table; |
| 9 | + |
| 10 | +/** |
| 11 | + * Test entity to test the correct generation of the enumerated type, the primary key, and name overriding |
| 12 | + * |
| 13 | + */ |
6 | 14 | @Entity
|
7 | 15 | @Table(name = "SQLTEST")
|
8 | 16 | public class SQLTestEntity {
|
9 |
| - @Id |
10 |
| - @Column(name = "MY_ID_FIELD") |
11 |
| - private Long id; |
12 |
| - |
13 |
| - @Column(name = "VALUENAME") |
14 |
| - private Integer integerValue; |
| 17 | + @Id |
| 18 | + @Column(name = "MY_ID_FIELD") |
| 19 | + private Long id; |
15 | 20 |
|
16 |
| - @OneToOne |
17 |
| - private ReferenceEntity refEntity; |
| 21 | + @Column(name = "VALUENAME") |
| 22 | + private Integer integerValue; |
18 | 23 |
|
19 |
| - @Enumerated(EnumType.STRING) |
20 |
| - @Column(length = 420, name = "ENUM_TEST_FIELD_NAME_OVERRIDE") |
21 |
| - private EnumForTest enumForTest; |
| 24 | + @Enumerated(EnumType.STRING) |
| 25 | + @Column(length = 420, name = "ENUM_TEST_FIELD_NAME_OVERRIDE") |
| 26 | + private EnumForTest enumForTest; |
22 | 27 |
|
23 |
| - private List<ReferenceEntity> referenceEntities; |
| 28 | + public Long getId() { |
24 | 29 |
|
25 |
| - public Long getId() { |
26 |
| - return id; |
27 |
| - } |
| 30 | + return this.id; |
| 31 | + } |
28 | 32 |
|
29 |
| - public void setId(Long id) { |
30 |
| - this.id = id; |
31 |
| - } |
| 33 | + public void setId(Long id) { |
32 | 34 |
|
33 |
| - public Integer getIntegerValue() { |
34 |
| - return integerValue; |
35 |
| - } |
| 35 | + this.id = id; |
| 36 | + } |
36 | 37 |
|
| 38 | + public Integer getIntegerValue() { |
37 | 39 |
|
38 |
| - public void setIntegerValue(Integer value) { |
39 |
| - this.integerValue = value; |
40 |
| - } |
| 40 | + return this.integerValue; |
| 41 | + } |
41 | 42 |
|
42 |
| - @OneToMany(mappedBy = "I_SHALL_BE_SKIPPED") |
43 |
| - public List<ReferenceEntity> getReferenceEntities() { |
44 |
| - return referenceEntities; |
45 |
| - } |
| 43 | + public void setIntegerValue(Integer value) { |
46 | 44 |
|
47 |
| - public void setReferenceEntities(List<ReferenceEntity> referenceEntities) { |
48 |
| - this.referenceEntities = referenceEntities; |
49 |
| - } |
| 45 | + this.integerValue = value; |
| 46 | + } |
50 | 47 |
|
| 48 | + public EnumForTest getEnumForTest() { |
51 | 49 |
|
52 |
| - public ReferenceEntity getRefEntity() { |
53 |
| - return refEntity; |
54 |
| - } |
| 50 | + return this.enumForTest; |
| 51 | + } |
55 | 52 |
|
56 |
| - public void setRefEntity(ReferenceEntity refEntity) { |
57 |
| - this.refEntity = refEntity; |
58 |
| - } |
| 53 | + public void setEnumForTest(EnumForTest enumForTest) { |
59 | 54 |
|
60 |
| - public EnumForTest getEnumForTest() { |
61 |
| - return enumForTest; |
62 |
| - } |
| 55 | + this.enumForTest = enumForTest; |
| 56 | + } |
63 | 57 |
|
64 |
| - public void setEnumForTest(EnumForTest enumForTest) { |
65 |
| - this.enumForTest = enumForTest; |
66 |
| - } |
67 | 58 | }
|
0 commit comments