spring-data-jpa — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited spring-data-jpa (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Provides patterns for Spring Data JPA repositories, entity relationships, queries, pagination, auditing, and transactions.
Creating repositories with CRUD operations, entity relationships, @Query annotations, pagination, auditing, or UUID primary keys.
To implement a repository interface:
@Repository
public interface UserRepository extends JpaRepository<User, Long> {
// Custom methods defined here
} Optional<User> findByEmail(String email);
List<User> findByStatusOrderByCreatedDateDesc(String status); @Query("SELECT u FROM User u WHERE u.status = :status")
List<User> findActiveUsers(@Param("status") String status); @Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false, length = 100)
private String email;
} @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Order> orders = new ArrayList<>();Validation: Test cascade behavior with a small dataset before applying to production data. Verify delete operations don't cascade unexpectedly.
@CreatedDate
@Column(nullable = false, updatable = false)
private LocalDateTime createdDate;1. Verify entity configuration:
2. Optimize query performance:
EXPLAIN ANALYZE on queries against large tables@EntityGraph to prevent N+1 queries3. Validate pagination:
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
// Derived query
List<Product> findByCategory(String category);
// Custom query
@Query("SELECT p FROM Product p WHERE p.price > :minPrice")
List<Product> findExpensiveProducts(@Param("minPrice") BigDecimal minPrice);
}@Service
public class ProductService {
private final ProductRepository repository;
public Page<Product> getProducts(int page, int size) {
Pageable pageable = PageRequest.of(page, size, Sort.by("name").ascending());
return repository.findAll(pageable);
}
}@Entity
@EntityListeners(AuditingEntityListener.class)
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@CreatedDate
@Column(nullable = false, updatable = false)
private LocalDateTime createdDate;
@LastModifiedDate
private LocalDateTime lastModifiedDate;
@CreatedBy
@Column(nullable = false, updatable = false)
private String createdBy;
}final modifiers@Value for DTOs@Id and @GeneratedValue annotations@Table and @Column annotations@EntityGraph to avoid N+1 query problemsFor comprehensive examples, detailed patterns, and advanced configurations, see:
@EntityGraph or JOIN FETCH in queries.CascadeType.REMOVE on large collections as it can cause performance issues.EAGER fetch type for collections; it can cause excessive database queries.@Transactional(readOnly = true) for read operations to enable optimizations.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.