-
Notifications
You must be signed in to change notification settings - Fork 211
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
Cant use compsite keys for domain id when extending JpaRepository #1139
Comments
@huhu72 thanks for reporting this. While we are fixing the issue the workaround would be turning this validation off in the preferences/settings. |
Should be fixed with b1e1bf7 |
latest version of Spring STS plugin for eclipse is still having this issue. it gives error 'Expected Domain ID type is 'long'' |
Is the code snippet to reproduce the issue still the same? If not, do you mind pasting the java code snippets for which you still observe the issue? |
I had problem with this version .
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
</parent>
I have to change it to fix it
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
</parent>
…On Thu, Dec 14, 2023 at 1:56 PM Alex Boyko ***@***.***> wrote:
Is the code snippet to reproduce the issue still the same? If not, do you
mind pasting the java code snippets for which you still observe the issue?
—
Reply to this email directly, view it on GitHub
<#1139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASKFRIAW55MBHID3YMEECTYJNDULAVCNFSM6AAAAAA64OFPLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJWGQYTCOBQGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Raja Sekhar Chaliki
|
@chalikir hmm... i wouldn't think that changing boot version could help with reconciling. The reconciling in this case isn't based on a boot version on the classpath... It seems though as i made a mistake in the fix to this issue. Someone else complained about the same issue here #1159. I have pushed a fix and would be great if you could try the snapshot distro build or nightly update site (see https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html) |
Ok. Will di. Thanks for letting me know.
…On Thu, Dec 14, 2023, 4:47 PM Alex Boyko ***@***.***> wrote:
@chalikir <https://github.com/chalikir> hmm... i wouldn't think that
changing boot version could help with reconciling. The reconciling in this
case isn't based on a boot version on the classpath... It seems though as i
made a mistake in the fix to this issue. Someone else complained about the
same issue here #1159
<#1159>. I have pushed a
fix and would be great if you could try the snapshot distro build or
nightly update site (see
https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html
)
—
Reply to this email directly, view it on GitHub
<#1139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASKFRKE3KE3HG7RNWLDLT3YJNXXRAVCNFSM6AAAAAA64OFPLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJWGY4TSMZYGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Is this issue fixed? Right now I'm having this issue in my version of STS. Would like to know if a newer version has arrived with a fix. |
@SajidhKareem All fixes were put into STS 4.21.0 if this is the version you're using and still seeing issues then please raise a new issue for it. As a workaround you can disable the validation for entity keys... it is somewhat experimental. |
@neo7BF Can you paste your |
This is the entity:
|
If your id is |
Yes correct. I was misled by the fact that I had downloaded sources |
@neo7BF no problem at all! This validation is very flaky unfortunately. Don't be shy to bring up any issues with this validation in the future even if they don't turn out to be issues. |
thanks @BoykoAlex
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.MappedSuperclass;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
@Setter
@Getter
@EqualsAndHashCode
@MappedSuperclass
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder(toBuilder = true)
public abstract class BaseEntity {
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
} import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;
import jakarta.persistence.EntityManager;
public abstract class RdsJpaRepository<T extends BaseEntity, ID>
extends SimpleJpaRepository<T, ID> {
public RdsJpaRepository(Class<T> domainClass, EntityManager em) {
super(domainClass, em);
}
public RdsJpaRepository(
JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
super(entityInformation, entityManager);
}
} |
Last comment extracted in #1220 |
Describe the bug

For Spring Boot Tools extension V1.50.0 on vscode)
When creating a interface that extends JpaRepository, it will throw an error saying "Expected Domain ID type is 'java.lang.String'vscode-spring-boot(DOMAIN_ID_FOR_REPOSITORY)". When I switch back to v1.49.0 the error is no longer there.
To Reproduce
Sample
The text was updated successfully, but these errors were encountered: