Add Chassis asset model and repository; define properties and metadata
This commit is contained in:
50
src/main/java/be/seeseepuff/pcinv/models/ChassisAsset.java
Normal file
50
src/main/java/be/seeseepuff/pcinv/models/ChassisAsset.java
Normal file
@@ -0,0 +1,50 @@
|
||||
package be.seeseepuff.pcinv.models;
|
||||
|
||||
import be.seeseepuff.pcinv.meta.AssetInfo;
|
||||
import be.seeseepuff.pcinv.meta.Description;
|
||||
import be.seeseepuff.pcinv.meta.HideInOverview;
|
||||
import be.seeseepuff.pcinv.meta.Property;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@AssetInfo(
|
||||
displayName = "Chassis",
|
||||
pluralName = "Chassis",
|
||||
type = "chassis"
|
||||
)
|
||||
@Table(name = "chassis_assets")
|
||||
public class ChassisAsset implements Asset
|
||||
{
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private long id;
|
||||
|
||||
/// The generic asset associated with this RAM.
|
||||
@OneToOne(orphanRemoval = true)
|
||||
private GenericAsset asset;
|
||||
|
||||
@Description("The number of 5.25\" drive bays in the chassis.")
|
||||
@Property("5.25\" Bays")
|
||||
@HideInOverview
|
||||
private Long bay5_25Count;
|
||||
|
||||
@Description("The number of 3.5\" drive bays in the chassis.")
|
||||
@Property("3.5\" Bays")
|
||||
private Long bay3_5Count;
|
||||
|
||||
@Description("The number of internal 3.5\" drive bays in the chassis.")
|
||||
@Property("Internal 3.5\" Bays")
|
||||
private Long internalBay3_5Count;
|
||||
|
||||
@Description("The number of 2.5\" drive bays in the chassis.")
|
||||
@Property("2.5\" Bays")
|
||||
private Long bay2_5Count;
|
||||
|
||||
@Description("The number of expansion slots in the chassis.")
|
||||
@Property("Expansion Slots")
|
||||
private Long expansionSlotCount;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package be.seeseepuff.pcinv.repositories;
|
||||
|
||||
import be.seeseepuff.pcinv.models.ChassisAsset;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public interface ChassisRepository extends JpaRepository<ChassisAsset, Long>, AssetRepository<ChassisAsset> {
|
||||
@Override
|
||||
default Class<ChassisAsset> getAssetType() {
|
||||
return ChassisAsset.class;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user