Skip to content

Commit 54a771b

Browse files
authored
Rename model suffix to entity (#12)
* Rename classes from model to entity * Update model class usage
1 parent e8a52f5 commit 54a771b

11 files changed

Lines changed: 43 additions & 47 deletions

src/main/java/net/theevilreaper/vulpes/api/model/AttributeModel.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/AttributeEntity.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import jakarta.persistence.Id;
77
import net.theevilreaper.vulpes.api.generator.VulpesGenerator;
88

9-
import javax.annotation.processing.Generated;
109
import java.util.UUID;
1110

1211
/**
@@ -19,7 +18,7 @@
1918
* </p>
2019
*/
2120
@Entity(name = "attributes")
22-
public class AttributeModel implements VulpesModel {
21+
public class AttributeEntity implements VulpesModel {
2322

2423
@Id
2524
@GeneratedValue(strategy = GenerationType.UUID)
@@ -36,20 +35,20 @@ public class AttributeModel implements VulpesModel {
3635
* This constructor is required for the JPA provider to instantiate the entity.
3736
* </p>
3837
*/
39-
public AttributeModel() {
38+
public AttributeEntity() {
4039
// No-argument constructor for JPA
4140
}
4241

4342
/**
44-
* Constructs a new {@link AttributeModel} with the specified values.
43+
* Constructs a new {@link AttributeEntity} with the specified values.
4544
*
4645
* @param id the unique identifier of the attribute
4746
* @param modelName the model name associated with the attribute
4847
* @param name the name of the attribute
4948
* @param defaultValue the default value of the attribute
5049
* @param maximumValue the maximum value of the attribute
5150
*/
52-
public AttributeModel(UUID id, String modelName, String name, double defaultValue, double maximumValue) {
51+
public AttributeEntity(UUID id, String modelName, String name, double defaultValue, double maximumValue) {
5352
this.id = id;
5453
this.modelName = modelName;
5554
this.name = name;

src/main/java/net/theevilreaper/vulpes/api/model/FontModel.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/FontEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* </p>
2121
*/
2222
@Entity(name = "fonts")
23-
public class FontModel implements VulpesModel {
23+
public class FontEntity implements VulpesModel {
2424

2525
@Id
2626
@GeneratedValue(strategy = GenerationType.UUID)
@@ -43,12 +43,12 @@ public class FontModel implements VulpesModel {
4343
* This constructor is required for the JPA provider to instantiate the entity.
4444
* </p>
4545
*/
46-
public FontModel() {
46+
public FontEntity() {
4747
// No-argument constructor for JPA
4848
}
4949

5050
/**
51-
* Constructs a new {@link FontModel} with the specified values.
51+
* Constructs a new {@link FontEntity} with the specified values.
5252
*
5353
* @param id the unique identifier of the font
5454
* @param modelName the model name associated with the font
@@ -60,7 +60,7 @@ public FontModel() {
6060
* @param chars the list of characters included in the font
6161
* @param shift the list of shift values for the font
6262
*/
63-
public FontModel(UUID id, String modelName, String name, String description, String type, int ascent, int height, List<String> chars, List<Double> shift) {
63+
public FontEntity(UUID id, String modelName, String name, String description, String type, int ascent, int height, List<String> chars, List<Double> shift) {
6464
this.id = id;
6565
this.modelName = modelName;
6666
this.name = name;

src/main/java/net/theevilreaper/vulpes/api/model/ItemModel.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/ItemEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* </p>
2222
*/
2323
@Entity(name = "items")
24-
public class ItemModel implements VulpesModel {
24+
public class ItemEntity implements VulpesModel {
2525

2626
@Id
2727
@GeneratedValue(strategy = GenerationType.UUID)
@@ -49,12 +49,12 @@ public class ItemModel implements VulpesModel {
4949
* This constructor is required for the JPA provider to instantiate the entity.
5050
* </p>
5151
*/
52-
public ItemModel() {
52+
public ItemEntity() {
5353
// No-argument constructor for JPA
5454
}
5555

5656
/**
57-
* Constructs a new {@link ItemModel} with the specified values.
57+
* Constructs a new {@link ItemEntity} with the specified values.
5858
*
5959
* @param id the unique identifier of the item
6060
* @param modelName the model name associated with the item
@@ -69,7 +69,7 @@ public ItemModel() {
6969
* @param lore the lore associated with the item
7070
* @param flags the flags associated with the item
7171
*/
72-
public ItemModel(UUID id, String modelName, String name, String description, String displayName, String material, String groupName, int customModelData, int amount, Map<String, Short> enchantments, List<String> lore, List<String> flags) {
72+
public ItemEntity(UUID id, String modelName, String name, String description, String displayName, String material, String groupName, int customModelData, int amount, Map<String, Short> enchantments, List<String> lore, List<String> flags) {
7373
this.id = id;
7474
this.modelName = modelName;
7575
this.name = name;

src/main/java/net/theevilreaper/vulpes/api/model/NotificationModel.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/NotificationEntity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* </p>
1919
*/
2020
@Entity(name = "notifications")
21-
public class NotificationModel implements VulpesModel {
21+
public class NotificationEntity implements VulpesModel {
2222

2323
@Id
2424
@GeneratedValue(strategy = GenerationType.UUID)
@@ -37,12 +37,12 @@ public class NotificationModel implements VulpesModel {
3737
* This constructor is required for the JPA provider to instantiate the entity.
3838
* </p>
3939
*/
40-
public NotificationModel() {
40+
public NotificationEntity() {
4141
// No-argument constructor for JPA
4242
}
4343

4444
/**
45-
* Constructs a new {@link NotificationModel} with the specified values.
45+
* Constructs a new {@link NotificationEntity} with the specified values.
4646
*
4747
* @param id the unique identifier of the notification
4848
* @param modelName the model name associated with the notification
@@ -52,7 +52,7 @@ public NotificationModel() {
5252
* @param frameType the frame type associated with the notification
5353
* @param title the title of the notification
5454
*/
55-
public NotificationModel(UUID id, String modelName, String name, String description, String material, String frameType, String title) {
55+
public NotificationEntity(UUID id, String modelName, String name, String description, String material, String frameType, String title) {
5656
this.id = id;
5757
this.modelName = modelName;
5858
this.name = name;

src/main/java/net/theevilreaper/vulpes/api/model/sound/SoundData.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/sound/SoundDataEntity.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@
44
import jakarta.persistence.GeneratedValue;
55
import jakarta.persistence.GenerationType;
66
import jakarta.persistence.Id;
7-
import net.theevilreaper.vulpes.api.generator.UuidV7Generator;
87
import net.theevilreaper.vulpes.api.generator.VulpesGenerator;
98
import net.theevilreaper.vulpes.api.model.VulpesModel;
10-
import org.hibernate.annotations.GenericGenerator;
11-
import org.hibernate.annotations.IdGeneratorType;
129

1310
import java.util.UUID;
1411

@@ -22,7 +19,7 @@
2219
* </p>
2320
*/
2421
@Entity(name = "sound_data")
25-
public class SoundData implements VulpesModel {
22+
public class SoundDataEntity implements VulpesModel {
2623

2724
@Id
2825
@GeneratedValue(strategy = GenerationType.UUID)
@@ -39,20 +36,20 @@ public class SoundData implements VulpesModel {
3936
* This constructor is required for the JPA provider to instantiate the entity.
4037
* </p>
4138
*/
42-
public SoundData() {
39+
public SoundDataEntity() {
4340
// No-argument constructor for JPA
4441
}
4542

4643
/**
47-
* Constructs a new {@link SoundData} with the specified values.
44+
* Constructs a new {@link SoundDataEntity} with the specified values.
4845
*
4946
* @param id the unique identifier of the sound data
5047
* @param name the name of the sound data
5148
* @param source the source file or location of the sound
5249
* @param volume the volume level of the sound
5350
* @param pitch the pitch of the sound
5451
*/
55-
public SoundData(UUID id, String name, String source, double volume, double pitch) {
52+
public SoundDataEntity(UUID id, String name, String source, double volume, double pitch) {
5653
this.id = id;
5754
this.name = name;
5855
this.source = source;

src/main/java/net/theevilreaper/vulpes/api/model/sound/SoundModel.java renamed to src/main/java/net/theevilreaper/vulpes/api/model/sound/SoundEntity.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* </p>
2222
*/
2323
@Entity(name = "sounds")
24-
public class SoundModel implements VulpesModel {
24+
public class SoundEntity implements VulpesModel {
2525

2626
@Id
2727
@GeneratedValue(strategy = GenerationType.UUID)
@@ -35,31 +35,31 @@ public class SoundModel implements VulpesModel {
3535
* This is a one-to-many relationship where each sound model can have multiple sound data entities.
3636
*/
3737
@OneToMany(mappedBy = "id")
38-
private List<SoundData> soundData;
38+
private List<SoundDataEntity> soundDatumEntities;
3939

4040
/**
4141
* Default constructor for JPA and Micronaut Data.
4242
* <p>
4343
* This constructor is required for the JPA provider to instantiate the entity.
4444
* </p>
4545
*/
46-
public SoundModel() {
46+
public SoundEntity() {
4747
// No-argument constructor for JPA
4848
}
4949

5050
/**
51-
* Constructs a new {@link SoundModel} with the specified values.
51+
* Constructs a new {@link SoundEntity} with the specified values.
5252
*
5353
* @param id the unique identifier of the sound model
5454
* @param modelName the name of the sound model
5555
* @param source the source file or location of the sound model
56-
* @param soundData the list of sound data related to this sound model
56+
* @param soundDatumEntities the list of sound data related to this sound model
5757
*/
58-
public SoundModel(UUID id, String modelName, String source, List<SoundData> soundData) {
58+
public SoundEntity(UUID id, String modelName, String source, List<SoundDataEntity> soundDatumEntities) {
5959
this.id = id;
6060
this.modelName = modelName;
6161
this.source = source;
62-
this.soundData = soundData;
62+
this.soundDatumEntities = soundDatumEntities;
6363
}
6464

6565
// Getters and setters for each field
@@ -123,17 +123,17 @@ public void setSource(String source) {
123123
*
124124
* @return the list of sound data
125125
*/
126-
public List<SoundData> getSoundData() {
127-
return soundData;
126+
public List<SoundDataEntity> getSoundData() {
127+
return soundDatumEntities;
128128
}
129129

130130
/**
131131
* Sets the list of sound data related to this sound model
132132
*
133-
* @param soundData the list of sound data to set
133+
* @param soundDatumEntities the list of sound data to set
134134
*/
135-
public void setSoundData(List<SoundData> soundData) {
136-
this.soundData = soundData;
135+
public void setSoundData(List<SoundDataEntity> soundDatumEntities) {
136+
this.soundDatumEntities = soundDatumEntities;
137137
}
138138

139139
/**
@@ -147,7 +147,7 @@ public String toString() {
147147
"id='" + id + '\'' +
148148
", modelName='" + modelName + '\'' +
149149
", source='" + source + '\'' +
150-
", soundData=" + soundData +
150+
", soundData=" + soundDatumEntities +
151151
'}';
152152
}
153153
}

src/main/java/net/theevilreaper/vulpes/api/repository/AttributeRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import io.micronaut.data.annotation.Repository;
44
import io.micronaut.data.repository.PageableRepository;
5-
import net.theevilreaper.vulpes.api.model.AttributeModel;
5+
import net.theevilreaper.vulpes.api.model.AttributeEntity;
66

77
import java.util.UUID;
88

99
@Repository
10-
public interface AttributeRepository extends PageableRepository<AttributeModel, UUID> {
10+
public interface AttributeRepository extends PageableRepository<AttributeEntity, UUID> {
1111
}

src/main/java/net/theevilreaper/vulpes/api/repository/FontRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import io.micronaut.data.annotation.Repository;
44
import io.micronaut.data.repository.PageableRepository;
5-
import net.theevilreaper.vulpes.api.model.FontModel;
5+
import net.theevilreaper.vulpes.api.model.FontEntity;
66

77
import java.util.UUID;
88

99
@Repository
10-
public interface FontRepository extends PageableRepository<FontModel, UUID> {
10+
public interface FontRepository extends PageableRepository<FontEntity, UUID> {
1111
}

src/main/java/net/theevilreaper/vulpes/api/repository/ItemRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import io.micronaut.data.annotation.Repository;
44
import io.micronaut.data.repository.PageableRepository;
5-
import net.theevilreaper.vulpes.api.model.ItemModel;
5+
import net.theevilreaper.vulpes.api.model.ItemEntity;
66

77
import java.util.UUID;
88

99
@Repository
10-
public interface ItemRepository extends PageableRepository<ItemModel, UUID> {
10+
public interface ItemRepository extends PageableRepository<ItemEntity, UUID> {
1111
}

src/main/java/net/theevilreaper/vulpes/api/repository/NotificationRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import io.micronaut.data.annotation.Repository;
44
import io.micronaut.data.repository.PageableRepository;
5-
import net.theevilreaper.vulpes.api.model.NotificationModel;
5+
import net.theevilreaper.vulpes.api.model.NotificationEntity;
66

77
import java.util.UUID;
88

99
@Repository
10-
public interface NotificationRepository extends PageableRepository<NotificationModel, UUID> {
10+
public interface NotificationRepository extends PageableRepository<NotificationEntity, UUID> {
1111
}

0 commit comments

Comments
 (0)