Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3789fee73b | |||
| 18baf239e8 |
28
src/main/java/be/seeseepuff/pcinv/models/CustomAsset.java
Normal file
28
src/main/java/be/seeseepuff/pcinv/models/CustomAsset.java
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
package be.seeseepuff.pcinv.models;
|
||||||
|
|
||||||
|
import be.seeseepuff.pcinv.meta.*;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a CPU or similar device.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@AssetInfo(
|
||||||
|
displayName = "Custom Device",
|
||||||
|
pluralName = "Custom Devices",
|
||||||
|
type = "custom"
|
||||||
|
)
|
||||||
|
@Table(name = "custom_assets")
|
||||||
|
public class CustomAsset implements Asset
|
||||||
|
{
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
@OneToOne(orphanRemoval = true)
|
||||||
|
private GenericAsset asset;
|
||||||
|
}
|
||||||
@@ -40,12 +40,12 @@ public class HddAsset implements Asset
|
|||||||
@InputList
|
@InputList
|
||||||
private String formFactor;
|
private String formFactor;
|
||||||
|
|
||||||
@Description("The drive's RPM (Revolutions Per Minute) speed, if applicable.")
|
@Description("The drive's RPM (Revolutions Per Minute) speed.")
|
||||||
@Property("RPM Speed")
|
@Property("RPM Speed")
|
||||||
@HideInOverview
|
@HideInOverview
|
||||||
private Long rpmSpeed;
|
private Long rpmSpeed;
|
||||||
|
|
||||||
@Description("The drive's cache size, if applicable.")
|
@Description("The drive's cache size.")
|
||||||
@Property("Cache Size")
|
@Property("Cache Size")
|
||||||
@HideInOverview
|
@HideInOverview
|
||||||
private Long cacheSize;
|
private Long cacheSize;
|
||||||
@@ -54,4 +54,19 @@ public class HddAsset implements Asset
|
|||||||
@Property("Drive Type")
|
@Property("Drive Type")
|
||||||
@InputList
|
@InputList
|
||||||
private String driveType;
|
private String driveType;
|
||||||
|
|
||||||
|
@Description("Number of heads in the drive.")
|
||||||
|
@Property("Heads")
|
||||||
|
@HideInOverview
|
||||||
|
private Integer heads;
|
||||||
|
|
||||||
|
@Description("Number of cylinders in the drive.")
|
||||||
|
@Property("Cylinders")
|
||||||
|
@HideInOverview
|
||||||
|
private Integer cylinders;
|
||||||
|
|
||||||
|
@Description("Number of sectors in the drive.")
|
||||||
|
@Property("Sectors")
|
||||||
|
@HideInOverview
|
||||||
|
private Integer sectors;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package be.seeseepuff.pcinv.repositories;
|
||||||
|
|
||||||
|
import be.seeseepuff.pcinv.models.CustomAsset;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public interface CustomRepository extends JpaRepository<CustomAsset, Long>, AssetRepository<CustomAsset> {
|
||||||
|
@Override
|
||||||
|
default Class<CustomAsset> getAssetType() {
|
||||||
|
return CustomAsset.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user