Add NIC asset model and repository
This commit is contained in:
37
src/main/java/be/seeseepuff/pcinv/models/NICAsset.java
Normal file
37
src/main/java/be/seeseepuff/pcinv/models/NICAsset.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package be.seeseepuff.pcinv.models;
|
||||||
|
|
||||||
|
import be.seeseepuff.pcinv.meta.*;
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@AssetInfo(
|
||||||
|
displayName = "Network Interface Controller",
|
||||||
|
pluralName = "Network Interface Controllers",
|
||||||
|
type = "nic"
|
||||||
|
)
|
||||||
|
@Table(name = "nic_assets")
|
||||||
|
public class NICAsset implements Asset
|
||||||
|
{
|
||||||
|
@Id
|
||||||
|
@GeneratedValue
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
/// The generic asset associated with this RAM.
|
||||||
|
@OneToOne(orphanRemoval = true)
|
||||||
|
private GenericAsset asset;
|
||||||
|
|
||||||
|
@Description("The MAC address of the network interface controller.")
|
||||||
|
@Property("MAC Address")
|
||||||
|
@HideInOverview
|
||||||
|
private String macAddress;
|
||||||
|
|
||||||
|
@Description("The type of interface used by the drive. E.g.: SATA, IDE, etc.")
|
||||||
|
@Property("Interface Type")
|
||||||
|
@HideInOverview
|
||||||
|
@InputList
|
||||||
|
private String interfaceType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package be.seeseepuff.pcinv.repositories;
|
||||||
|
|
||||||
|
import be.seeseepuff.pcinv.models.NICAsset;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
|
public interface NICRepository extends JpaRepository<NICAsset, Long>, AssetRepository<NICAsset> {
|
||||||
|
@Override
|
||||||
|
default Class<NICAsset> getAssetType() {
|
||||||
|
return NICAsset.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user