Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The method findAllByAccessPlantsSet_AccessPlantKey_Plant_PlantIdIn is working properly in spring boot 1.5.3-RELEASE but not working in 2.7.16 #3226

Closed
pvsreejesh opened this issue Nov 16, 2023 · 5 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@pvsreejesh
Copy link

pvsreejesh commented Nov 16, 2023

The method findAllByAccessPlantsSet_AccessPlantKey_Plant_PlantIdIn is working properly in spring boot 1.5.3-RELEASE but not working in 2.7.16
Below is the code

public interface UserPagingAndSortingRepository extends PagingAndSortingRepository<User, Integer> {
  Page<User> findAllByAccessPlantsSet_AccessPlantKey_Plant_PlantIdIn(List<Long> plantIds, Pageable pageParam);
}
@Entity
@Table(name = "RM_Users")
public class User extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "UserId")
	@Access(value = AccessType.PROPERTY)
	private Long userId;

	@Column(name = "UserName")
	private String userName;

	@Column(name = "GroupId")
	private Long groupId;

	@Column(name = "EmailId")
	private String emailId;

	@Column(name = "FirstName")
	private String firstName;

	@Column(name = "LastName")
	private String lastName;

	@Column(name = "password")
	@JsonIgnore
	private String password;

	@Column(name = "CountryId")
	private Long countryId;

	@Column(name = "Status")
	private String status;

	@Column(name = "PlantID")
	private Integer defaultPlantId;

	@ManyToMany(fetch = FetchType.EAGER, cascade = { CascadeType.MERGE }, targetEntity = Group.class)
	@JoinTable(name = "RM_UserGroups", joinColumns = @JoinColumn(name = USER_ID, referencedColumnName = USER_ID), inverseJoinColumns = @JoinColumn(name = GROUP_ID, referencedColumnName = GROUP_ID))
	@OrderBy("id asc")
	private Set<Group> groups;

	@OneToMany(mappedBy = "rmUser", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
	private Set<AccessPlant> accessPlantsSet;
	
	@Column(name = "ERPReferenceID")
	private String erpReferenceId;
	
	@Column(name = "PersonalID")
	private String personalId;
	
	@Transient
	private String defaultLanguage;
	
	@Column(name = "AuthUserReferenceID")
	private String authUserReferenceID;
/**setter and getter of the above fields**/
}
@Entity
@Table(name = "RM_AccessPlants")
public class AccessPlant extends BaseEntity {
	private static final long serialVersionUID = -5392387870562061659L;

	@EmbeddedId
	private AccessPlantKey accessPlantKey;

	@MapsId(value = "userId")
	@ManyToOne
	@JoinColumn(name = "UserID", referencedColumnName = "UserId", insertable = false, updatable = false)
	private User rmUser;

	/**getter and setter**/

	@Embeddable
	public static class AccessPlantKey implements Serializable {
		private static final long serialVersionUID = 8734911584517266683L;

		@Column(name = "UserID")
		private Long userId;
		@OneToOne
		@JoinColumn(name = "PlantID")
		private Plant plant;

		/** getter and setter**/
	}
}
@Entity
@Table(name = "Mstr_Plant")
public class Plant extends BaseEntity {
	private static final long serialVersionUID = 1265334950544498967L;
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "PlantID")
	@Access(value = AccessType.PROPERTY)
	private Long plantId;

	@Column(name = "PlantCode")
	private String plantCode;

	@Column(name = "PlantName")
	private String plantName;
/** getter and setter method**/
}

It generates query properly and working. below is the query

Hibernate:
select
TOP(?) user0_.UserId as UserId1_9_,
user0_.Euser as Euser2_9_,
user0_.LastUpdatedon as LastUpda3_9_,
user0_.AuthUserReferenceID as AuthUser4_9_,
user0_.CountryId as CountryI5_9_,
user0_.PlantID as PlantID6_9_,
user0_.EmailId as EmailId7_9_,
user0_.ERPReferenceID as ERPRefer8_9_,
user0_.FirstName as FirstNam9_9_,
user0_.GroupId as GroupId10_9_,
user0_.LastName as LastNam11_9_,
user0_.password as passwor12_9_,
user0_.PersonalID as Persona13_9_,
user0_.Status as Status14_9_,
user0_.UserName as UserNam15_9_
from
dbo.RM_Users user0_
left outer join
dbo.RM_AccessPlants accessplan1_
on user0_.UserId=accessplan1_.UserID
where
accessplan1_.PlantID in (
?
)
2023-11-14 15:40:21.963 [http-nio-8082-exec-3] INFO c.g.i.d.m.r.p.DataSourceMultiTenantConnectionProvider.selectDataSource(37) - [DataSourceMultiTenantConnectionProvider] TargetDataSource lookupKey : getmail.lt
Hibernate:
select
groups0_.UserId as UserId1_7_0_,
groups0_.GroupId as GroupId2_7_0_,
group1_.GroupId as GroupId1_4_1_,
group1_.Euser as Euser2_4_1_,
group1_.LastUpdatedon as LastUpda3_4_1_,
group1_.DefaultGroup as DefaultG4_4_1_,
group1_.DeptId as DeptId5_4_1_,
group1_.GroupCode as GroupCod6_4_1_,
group1_.GroupDesc as GroupDes7_4_1_,
group1_.GroupName as GroupNam8_4_1_,
group1_.PlantID as PlantID9_4_1_,
group1_.Status as Status10_4_1_
from
dbo.RM_UserGroups groups0_
inner join
dbo.RM_Group group1_
on groups0_.GroupId=group1_.GroupId
where
groups0_.UserId=?
order by
group1_.GroupId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessplan0_.UserID as UserID1_1_0_,
accessplan0_.PlantID as PlantID4_1_0_,
accessplan0_.PlantID as PlantID4_1_1_,
accessplan0_.UserID as UserID1_1_1_,
accessplan0_.Euser as Euser2_1_1_,
accessplan0_.LastUpdatedon as LastUpda3_1_1_,
plant1_.PlantID as PlantID1_0_2_,
plant1_.Euser as Euser2_0_2_,
plant1_.LastUpdatedon as LastUpda3_0_2_,
plant1_.PlantCode as PlantCod4_0_2_,
plant1_.PlantName as PlantNam5_0_2_
from
dbo.RM_AccessPlants accessplan0_
inner join
dbo.Mstr_Plant plant1_
on accessplan0_.PlantID=plant1_.PlantID
where
accessplan0_.UserID=?
Hibernate:
select
groups0_.UserId as UserId1_7_0_,
groups0_.GroupId as GroupId2_7_0_,
group1_.GroupId as GroupId1_4_1_,
group1_.Euser as Euser2_4_1_,
group1_.LastUpdatedon as LastUpda3_4_1_,
group1_.DefaultGroup as DefaultG4_4_1_,
group1_.DeptId as DeptId5_4_1_,
group1_.GroupCode as GroupCod6_4_1_,
group1_.GroupDesc as GroupDes7_4_1_,
group1_.GroupName as GroupNam8_4_1_,
group1_.PlantID as PlantID9_4_1_,
group1_.Status as Status10_4_1_
from
dbo.RM_UserGroups groups0_
inner join
dbo.RM_Group group1_
on groups0_.GroupId=group1_.GroupId
where
groups0_.UserId=?
order by
group1_.GroupId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessplan0_.UserID as UserID1_1_0_,
accessplan0_.PlantID as PlantID4_1_0_,
accessplan0_.PlantID as PlantID4_1_1_,
accessplan0_.UserID as UserID1_1_1_,
accessplan0_.Euser as Euser2_1_1_,
accessplan0_.LastUpdatedon as LastUpda3_1_1_,
plant1_.PlantID as PlantID1_0_2_,
plant1_.Euser as Euser2_0_2_,
plant1_.LastUpdatedon as LastUpda3_0_2_,
plant1_.PlantCode as PlantCod4_0_2_,
plant1_.PlantName as PlantNam5_0_2_
from
dbo.RM_AccessPlants accessplan0_
inner join
dbo.Mstr_Plant plant1_
on accessplan0_.PlantID=plant1_.PlantID
where
accessplan0_.UserID=?
Hibernate:
select
groups0_.UserId as UserId1_7_0_,
groups0_.GroupId as GroupId2_7_0_,
group1_.GroupId as GroupId1_4_1_,
group1_.Euser as Euser2_4_1_,
group1_.LastUpdatedon as LastUpda3_4_1_,
group1_.DefaultGroup as DefaultG4_4_1_,
group1_.DeptId as DeptId5_4_1_,
group1_.GroupCode as GroupCod6_4_1_,
group1_.GroupDesc as GroupDes7_4_1_,
group1_.GroupName as GroupNam8_4_1_,
group1_.PlantID as PlantID9_4_1_,
group1_.Status as Status10_4_1_
from
dbo.RM_UserGroups groups0_
inner join
dbo.RM_Group group1_
on groups0_.GroupId=group1_.GroupId
where
groups0_.UserId=?
order by
group1_.GroupId asc
Hibernate:
select
accessplan0_.UserID as UserID1_1_0_,
accessplan0_.PlantID as PlantID4_1_0_,
accessplan0_.PlantID as PlantID4_1_1_,
accessplan0_.UserID as UserID1_1_1_,
accessplan0_.Euser as Euser2_1_1_,
accessplan0_.LastUpdatedon as LastUpda3_1_1_,
plant1_.PlantID as PlantID1_0_2_,
plant1_.Euser as Euser2_0_2_,
plant1_.LastUpdatedon as LastUpda3_0_2_,
plant1_.PlantCode as PlantCod4_0_2_,
plant1_.PlantName as PlantNam5_0_2_
from
dbo.RM_AccessPlants accessplan0_
inner join
dbo.Mstr_Plant plant1_
on accessplan0_.PlantID=plant1_.PlantID
where
accessplan0_.UserID=?
Hibernate:
select
groups0_.UserId as UserId1_7_0_,
groups0_.GroupId as GroupId2_7_0_,
group1_.GroupId as GroupId1_4_1_,
group1_.Euser as Euser2_4_1_,
group1_.LastUpdatedon as LastUpda3_4_1_,
group1_.DefaultGroup as DefaultG4_4_1_,
group1_.DeptId as DeptId5_4_1_,
group1_.GroupCode as GroupCod6_4_1_,
group1_.GroupDesc as GroupDes7_4_1_,
group1_.GroupName as GroupNam8_4_1_,
group1_.PlantID as PlantID9_4_1_,
group1_.Status as Status10_4_1_
from
dbo.RM_UserGroups groups0_
inner join
dbo.RM_Group group1_
on groups0_.GroupId=group1_.GroupId
where
groups0_.UserId=?
order by
group1_.GroupId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc
Hibernate:
select
accessrigh0_.GroupId as GroupId1_5_0_,
accessrigh0_.AccessId as AccessId2_5_0_,
accessrigh1_.AccessId as AccessId1_2_1_,
accessrigh1_.Euser as Euser2_2_1_,
accessrigh1_.LastUpdatedon as LastUpda3_2_1_,
accessrigh1_.AccessCode as AccessCo4_2_1_,
accessrigh1_.AccessName as AccessNa5_2_1_,
accessrigh1_.DefaultRight as DefaultR6_2_1_,
accessrigh1_.ModuleId as ModuleId7_2_1_
from
dbo.RM_GroupAccessRights accessrigh0_
inner join
dbo.RM_AccessRights accessrigh1_
on accessrigh0_.AccessId=accessrigh1_.AccessId
where
accessrigh0_.GroupId=?
order by
accessrigh1_.AccessId asc

After upgrading to spring boot 2.7.16, it is generating wrong query and not getting result as expected.
this is the link to the generated query https://docs.google.com/document/d/13cXhXMxCq6IzL2e4CcxRGFKI2BDkQX-O1I5ptxxVtgg/edit?usp=drive_link

As the link is not accessible please find below the generated query by spring boot 2.7,.16

Hibernate: 
    select
        top(?) user0_.UserId as userid1_9_,
        user0_.Euser as euser2_9_,
        user0_.LastUpdatedon as lastupda3_9_,
        user0_.AuthUserReferenceID as authuser4_9_,
        user0_.CountryId as countryi5_9_,
        user0_.PlantID as plantid6_9_,
        user0_.EmailId as emailid7_9_,
        user0_.ERPReferenceID as erprefer8_9_,
        user0_.FirstName as firstnam9_9_,
        user0_.GroupId as groupid10_9_,
        user0_.LastName as lastnam11_9_,
        user0_.password as passwor12_9_,
        user0_.PersonalID as persona13_9_,
        user0_.Status as status14_9_,
        user0_.UserName as usernam15_9_ 
    from
        dbo.RM_Users user0_ 
    left outer join
        dbo.RM_AccessPlants accessplan1_ 
            on user0_.UserId=accessplan1_.UserID 
    left outer join
        dbo.Mstr_Plant plant2_ 
            on accessplan1_.PlantID=plant2_.PlantID 
    where
        plant2_.PlantID in (
            ?
        )
2023-11-14 16:49:48.085 [http-nio-8081-exec-3] INFO  c.g.i.d.m.r.p.DataSourceMultiTenantConnectionProvider.selectDataSource(37) - [DataSourceMultiTenantConnectionProvider] TargetDataSource lookupKey : getmail.lt
Hibernate: 
    select
        groups0_.UserId as userid1_7_0_,
        groups0_.GroupId as groupid2_7_0_,
        group1_.GroupId as groupid1_4_1_,
        group1_.Euser as euser2_4_1_,
        group1_.LastUpdatedon as lastupda3_4_1_,
        group1_.DefaultGroup as defaultg4_4_1_,
        group1_.DeptId as deptid5_4_1_,
        group1_.GroupCode as groupcod6_4_1_,
        group1_.GroupDesc as groupdes7_4_1_,
        group1_.GroupName as groupnam8_4_1_,
        group1_.PlantID as plantid9_4_1_,
        group1_.Status as status10_4_1_ 
    from
        dbo.RM_UserGroups groups0_ 
    inner join
        dbo.RM_Group group1_ 
            on groups0_.GroupId=group1_.GroupId 
    where
        groups0_.UserId=? 
    order by
        group1_.GroupId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessplan0_.UserID as userid1_1_0_,
        accessplan0_.PlantID as plantid4_1_0_,
        accessplan0_.PlantID as plantid4_1_1_,
        accessplan0_.UserID as userid1_1_1_,
        accessplan0_.Euser as euser2_1_1_,
        accessplan0_.LastUpdatedon as lastupda3_1_1_,
        plant1_.PlantID as plantid1_0_2_,
        plant1_.Euser as euser2_0_2_,
        plant1_.LastUpdatedon as lastupda3_0_2_,
        plant1_.PlantCode as plantcod4_0_2_,
        plant1_.PlantName as plantnam5_0_2_ 
    from
        dbo.RM_AccessPlants accessplan0_ 
    left outer join
        dbo.Mstr_Plant plant1_ 
            on accessplan0_.PlantID=plant1_.PlantID 
    where
        accessplan0_.UserID=?
Hibernate: 
    select
        groups0_.UserId as userid1_7_0_,
        groups0_.GroupId as groupid2_7_0_,
        group1_.GroupId as groupid1_4_1_,
        group1_.Euser as euser2_4_1_,
        group1_.LastUpdatedon as lastupda3_4_1_,
        group1_.DefaultGroup as defaultg4_4_1_,
        group1_.DeptId as deptid5_4_1_,
        group1_.GroupCode as groupcod6_4_1_,
        group1_.GroupDesc as groupdes7_4_1_,
        group1_.GroupName as groupnam8_4_1_,
        group1_.PlantID as plantid9_4_1_,
        group1_.Status as status10_4_1_ 
    from
        dbo.RM_UserGroups groups0_ 
    inner join
        dbo.RM_Group group1_ 
            on groups0_.GroupId=group1_.GroupId 
    where
        groups0_.UserId=? 
    order by
        group1_.GroupId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessrigh0_.GroupId as groupid1_5_0_,
        accessrigh0_.AccessId as accessid2_5_0_,
        accessrigh1_.AccessId as accessid1_2_1_,
        accessrigh1_.Euser as euser2_2_1_,
        accessrigh1_.LastUpdatedon as lastupda3_2_1_,
        accessrigh1_.AccessCode as accessco4_2_1_,
        accessrigh1_.AccessName as accessna5_2_1_,
        accessrigh1_.DefaultRight as defaultr6_2_1_,
        accessrigh1_.ModuleId as moduleid7_2_1_ 
    from
        dbo.RM_GroupAccessRights accessrigh0_ 
    inner join
        dbo.RM_AccessRights accessrigh1_ 
            on accessrigh0_.AccessId=accessrigh1_.AccessId 
    where
        accessrigh0_.GroupId=? 
    order by
        accessrigh1_.AccessId asc
Hibernate: 
    select
        accessplan0_.UserID as userid1_1_0_,
        accessplan0_.PlantID as plantid4_1_0_,
        accessplan0_.PlantID as plantid4_1_1_,
        accessplan0_.UserID as userid1_1_1_,
        accessplan0_.Euser as euser2_1_1_,
        accessplan0_.LastUpdatedon as lastupda3_1_1_,
        plant1_.PlantID as plantid1_0_2_,
        plant1_.Euser as euser2_0_2_,
        plant1_.LastUpdatedon as lastupda3_0_2_,
        plant1_.PlantCode as plantcod4_0_2_,
        plant1_.PlantName as plantnam5_0_2_ 
    from
        dbo.RM_AccessPlants accessplan0_ 
    left outer join
        dbo.Mstr_Plant plant1_ 
            on accessplan0_.PlantID=plant1_.PlantID 
    where
        accessplan0_.UserID=?
Hibernate: 
    select
        plant0_.PlantID as plantid1_0_0_,
        plant0_.Euser as euser2_0_0_,
        plant0_.LastUpdatedon as lastupda3_0_0_,
        plant0_.PlantCode as plantcod4_0_0_,
        plant0_.PlantName as plantnam5_0_0_ 
    from
        dbo.Mstr_Plant plant0_ 
    where
        plant0_.PlantID=?

I am looking to find solution to fix this issue
Thanks

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 16, 2023
@schauder
Copy link
Contributor

Please reduce the example to the essentials.
Also please clarify in what sense the SQL statement is wrong.
And please include the generated SQL in the question, not a separate document.
BTW: that document isn't even accessible.

Finally: It is hard to tall with the current state of the issue, but it seems likely that it is a Hibernate issue.

@schauder schauder added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 16, 2023
@mp911de
Copy link
Member

mp911de commented Nov 16, 2023

One more thing: Spring Data 2.7 is out of maintenance. Please upgrade to the latest 3.x release, 3.1.5.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 16, 2023
@pvsreejesh
Copy link
Author

I cant upgrade to spring boot 3 or above as it didn't have token store and our spring boot application depends on token store there are around 20 spring boot application.
if it is a hibernate issue how to fix ?

@pvsreejesh
Copy link
Author

Updated the question with the second query ss well

@christophstrobl
Copy link
Member

Closing this one. As already mentioned 2.7.x is out of maintenance.
If the problem persists with newer versions eg. 3.2.x please reopen the issue and provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

@christophstrobl christophstrobl added status: invalid An issue that we don't feel is valid and removed status: feedback-provided Feedback has been provided labels Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants