• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hazendaz / jmockit1 / 496

15 Nov 2025 05:33PM UTC coverage: 72.192% (-0.008%) from 72.2%
496

push

github

web-flow
Merge pull request #412 from hazendaz/renovate/major-spring-core

Update spring core to v7 (major)

5677 of 8360 branches covered (67.91%)

Branch coverage included in aggregate %.

11922 of 16018 relevant lines covered (74.43%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/samples/petclinic/src/main/java/petclinic/util/BaseEntity.java
1
/*
2
 * MIT License
3
 * Copyright (c) 2006-2025 JMockit developers
4
 * See LICENSE file for full license text.
5
 */
6
package petclinic.util;
7

8
import static jakarta.persistence.GenerationType.IDENTITY;
9

10
import jakarta.persistence.GeneratedValue;
11
import jakarta.persistence.Id;
12
import jakarta.persistence.MappedSuperclass;
13

14
import java.io.Serializable;
15

16
/**
17
 * Base class for all entity types, containing the id property, which is automatically generated.
18
 */
19
@MappedSuperclass
20
public class BaseEntity implements Serializable {
1✔
21
    private static final long serialVersionUID = 1L;
22
    @Id
23
    @GeneratedValue(strategy = IDENTITY)
24
    protected Integer id;
25

26
    public Integer getId() {
27
        return id;
1✔
28
    }
29

30
    public void setId(Integer id) {
31
        this.id = id;
×
32
    }
×
33

34
    public boolean isNew() {
35
        return id == null;
1✔
36
    }
37

38
    @SuppressWarnings("NonFinalFieldReferenceInEquals")
39
    @Override
40
    public final boolean equals(Object other) {
41
        if (this == other) {
1✔
42
            return true;
1✔
43
        }
44
        if (!(other instanceof BaseEntity)) {
1!
45
            return false;
×
46
        }
47

48
        BaseEntity otherEntity = (BaseEntity) other;
1✔
49

50
        return id != null ? id.equals(otherEntity.id) : otherEntity.id == null;
1!
51
    }
52

53
    @SuppressWarnings("NonFinalFieldReferencedInHashCode")
54
    @Override
55
    public final int hashCode() {
56
        return id == null ? -1 : id;
1!
57
    }
58
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc