38 lines
1.4 KiB
Java
Executable File
38 lines
1.4 KiB
Java
Executable File
package com.ankurm.brokenprobe;
|
|
|
|
import jakarta.persistence.Entity;
|
|
import jakarta.persistence.GeneratedValue;
|
|
import jakarta.persistence.GenerationType;
|
|
import jakarta.persistence.Id;
|
|
import jakarta.persistence.NamedQuery;
|
|
import jakarta.persistence.Table;
|
|
|
|
/**
|
|
* DELIBERATELY BROKEN entity used ONLY by
|
|
* {@code com.ankurm.hibernatedemo.namedquery.NamedQueryStartupValidationTest}, via a fully
|
|
* standalone Hibernate bootstrap (StandardServiceRegistryBuilder + MetadataSources) that never
|
|
* touches the shared Spring Boot application context.
|
|
*
|
|
* <p>Deliberately placed OUTSIDE the {@code com.ankurm.hibernatedemo} package tree. Spring
|
|
* Boot's default JPA entity scanning walks every subpackage of the {@code @SpringBootApplication}
|
|
* class's package ({@code com.ankurm.hibernatedemo}), so a broken {@code @NamedQuery} anywhere
|
|
* under that tree would fail {@code @SpringBootTest} context bootstrap for EVERY test in this
|
|
* shared repository, not just this one. Keeping it here means only the standalone bootstrap
|
|
* below ever sees it.
|
|
*/
|
|
@Entity
|
|
@Table(name = "broken_nq_employee")
|
|
@NamedQuery(name = "BrokenNamedQueryEmployee.badProperty",
|
|
query = "SELECT e FROM BrokenNamedQueryEmployee e WHERE e.firsNam = :name") // typo: firsNam
|
|
public class BrokenNamedQueryEmployee {
|
|
|
|
@Id
|
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
private String firstName;
|
|
|
|
protected BrokenNamedQueryEmployee() {
|
|
}
|
|
}
|