Skip to content
Snippets Groups Projects
Select Git revision
  • 00a25e55bad18098aaa8aee52fa4cf87cbd670fe
  • master default
  • renovate/datatables.version
  • renovate/opencsv.version
  • renovate/org.springframework.boot-spring-boot-starter-parent-3.x
  • renovate/junit-jupiter-engine.version
  • renovate/selenium.version
  • renovate/testcontainer.version
  • demo
  • v1_8_1
  • v2.18.1
  • v2.18.0
  • v2.17.2
  • v2.17.1
  • v2.17.0
  • v2.16.1
  • v2.16.0
  • v2.15.1
  • v2.15.0
  • v2.14.0
  • v2.13.0
  • v2.12.0
  • v2.11.0
  • v2.10.0
  • v2.9.2
  • v2.9.1
  • v2.9.0
  • v2.8.0
  • testPipeline2
  • v2.7.0
30 results

Image.java

Blame
  • Image.java 1.42 KiB
    package de.deadlocker8.budgetmaster.images;
    
    import com.google.gson.annotations.Expose;
    import de.deadlocker8.budgetmaster.accounts.Account;
    
    import javax.persistence.*;
    import javax.validation.constraints.NotNull;
    import javax.validation.constraints.Size;
    import java.util.List;
    import java.util.Objects;
    
    @Entity
    public class Image
    {
    	@Id
    	@GeneratedValue(strategy = GenerationType.IDENTITY)
    	@Expose
    	private Integer ID;
    
    	@NotNull
    	@Size(min = 1)
    	@Expose
    	private String imagePath;
    
    	@OneToMany(mappedBy = "icon", fetch = FetchType.LAZY)
    	private List<Account> referringAccounts;
    
    	public Image(String imagePath)
    	{
    		this.imagePath = imagePath;
    	}
    
    	public Image()
    	{
    	}
    
    	public Integer getID()
    	{
    		return ID;
    	}
    
    	public void setID(Integer ID)
    	{
    		this.ID = ID;
    	}
    
    	public String getImagePath()
    	{
    		return imagePath;
    	}
    
    	public void setImagePath(String imagePath)
    	{
    		this.imagePath = imagePath;
    	}
    
    	public List<Account> getReferringAccounts()
    	{
    		return referringAccounts;
    	}
    
    	@Override
    	public String toString()
    	{
    		return "Image{" +
    				"ID=" + ID +
    				", imagePath='" + imagePath + '\'' +
    				'}';
    	}
    
    	@Override
    	public boolean equals(Object o)
    	{
    		if(this == o) return true;
    		if(o == null || getClass() != o.getClass()) return false;
    		Image image = (Image) o;
    		return Objects.equals(ID, image.ID) && Objects.equals(imagePath, image.imagePath);
    	}
    
    	@Override
    	public int hashCode()
    	{
    		return Objects.hash(ID, imagePath);
    	}
    }