Clover icon

sunshower-base

  1. Project Clover database Mon May 7 2018 22:12:38 UTC
  2. Package io.sunshower.persist

File AbstractEntity.java

 

Coverage histogram

../../../img/srcFileCovDistChart0.png
49% of files have more coverage

Code metrics

10
14
5
1
52
41
10
0.71
2.8
5
2

Classes

Class Line # Actions
AbstractEntity 13 14 10
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.persist;
2   
3    import io.sunshower.common.Identifier;
4    import io.sunshower.persist.internal.jaxb.IdentifierAdapter;
5    import javax.persistence.Id;
6    import javax.persistence.MappedSuperclass;
7    import javax.xml.bind.annotation.XmlID;
8    import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
9    import org.eclipse.persistence.oxm.annotations.XmlDiscriminatorNode;
10   
11    @MappedSuperclass
12    @XmlDiscriminatorNode("@type")
 
13    public class AbstractEntity extends SequenceIdentityAssignedEntity<Identifier> {
14   
15    static final transient Sequence<Identifier> DEFAULT_SEQUENCE;
16   
 
17  0 toggle static {
18  0 DEFAULT_SEQUENCE = Identifiers.newSequence(true);
19    }
20   
21    @Id
22    @XmlID
23    @XmlJavaTypeAdapter(IdentifierAdapter.class)
24    private Identifier id;
25   
 
26  0 toggle protected AbstractEntity() {
27  0 super(DEFAULT_SEQUENCE);
28    }
29   
 
30  0 toggle @Override
31    public boolean equals(Object o) {
32  0 if (this == o) return true;
33  0 if (!(o instanceof AbstractEntity)) return false;
34  0 if (!super.equals(o)) return false;
35   
36  0 AbstractEntity that = (AbstractEntity) o;
37   
38  0 return id != null ? id.equals(that.id) : that.id == null;
39    }
40   
 
41  0 toggle @Override
42    public int hashCode() {
43  0 int result = super.hashCode();
44  0 result = 31 * result + (id != null ? id.hashCode() : 0);
45  0 return result;
46    }
47   
 
48  0 toggle @Override
49    public String toString() {
50  0 return String.format("%s{" + "id=" + id + '}', getClass());
51    }
52    }