Add Sound Adapter asset model and repository; standardize asset type naming
This commit is contained in:
@@ -11,7 +11,7 @@ import lombok.Setter;
|
||||
@AssetInfo(
|
||||
displayName = "Display Adapter",
|
||||
pluralName = "Display Adapters",
|
||||
type = "GPU"
|
||||
type = "gpu"
|
||||
)
|
||||
@Table(name = "gpu_assets")
|
||||
public class DisplayAdapterAsset implements Asset
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.Setter;
|
||||
@AssetInfo(
|
||||
displayName = "Hard Drive",
|
||||
pluralName = "Hard Drives",
|
||||
type = "HDD"
|
||||
type = "hdd"
|
||||
)
|
||||
@Table(name = "hdd_assets")
|
||||
public class HddAsset implements Asset
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.Setter;
|
||||
@AssetInfo(
|
||||
displayName = "Random Access Memory",
|
||||
pluralName = "Random Access Memories",
|
||||
type = "RAM"
|
||||
type = "ram"
|
||||
)
|
||||
@Table(name = "ram_assets")
|
||||
public class RamAsset implements Asset
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import be.seeseepuff.pcinv.meta.*;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@AssetInfo(
|
||||
displayName = "Sound Adapter",
|
||||
pluralName = "Sound Adapters",
|
||||
type = "sound"
|
||||
)
|
||||
@Table(name = "sound_assets")
|
||||
public class SoundAdapterAsset implements Asset
|
||||
{
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
/// The generic asset associated with this RAM.
|
||||
@OneToOne(orphanRemoval = true)
|
||||
private GenericAsset asset;
|
||||
|
||||
@Property("Chipset")
|
||||
@InputList
|
||||
private String chipset;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package be.seeseepuff.pcinv.repositories;
|
||||
|
||||
import be.seeseepuff.pcinv.models.SoundAdapterAsset;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface SoundAdapterRepository extends JpaRepository<SoundAdapterAsset, Long>, AssetRepository<SoundAdapterAsset> {
|
||||
@Override
|
||||
default Class<SoundAdapterAsset> getAssetType() {
|
||||
return SoundAdapterAsset.class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user