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

LockingAndVersioningRepository's delete method clash with CrudRepository'delete method #84

Closed
lmtoo opened this issue Oct 15, 2019 · 7 comments

Comments

@lmtoo
Copy link

lmtoo commented Oct 15, 2019

I use kotlin defined an interface as follow:

@RepositoryRestResource(path = "documents", collectionResourceRel = "documents") interface DocumentRepository : JpaRepository<Document, String>, LockingAndVersioningRepository<Document, String>

but the compiler compilation fails :
Inherited platform declarations clash: The following declarations have the same JVM signature (delete(Ljava/lang/Object;)V) fun <S : Document!> delete(p0: S!): Unit defined in com.lubansoft.archives.document.DocumentRepository fun delete(p0: Document): Unit defined in com.lubansoft.archives.document.DocumentRepository

@paulcwarren
Copy link
Owner

I am not a Kotlin guy and haven't had an opportunity to try it yet. Although, I note it increasing popularity and buzz (at SpringOne this year). But all this means that I might need a bit of help with this one. Is it possible that you can provide a sample application that exhibits the problem?

@schocco
Copy link

schocco commented Apr 9, 2020

both, CrudRepository and LockingAndVersioningRepository define a delete() method.
The accepted type is <S extends T> in the versioningRepo but just T in the CrudRepo - this might cause the clash.

@lmtoo As a workaround you can override the delete method in your interface like this:

interface DocumentRepository : CrudRepository<Document, UUID>, LockingAndVersioningRepository<Document, UUID> {

    override fun delete(document: Document) {
    }

}

@paulcwarren
Copy link
Owner

Thanks for the info @schocco that is helpful. I can certainly take a look at changing that return type for you both.

paulcwarren pushed a commit that referenced this issue Apr 10, 2020
- so tht downstream consumers dont see an erasure signature conflicts

Fixes #84
@paulcwarren
Copy link
Owner

paulcwarren commented Apr 10, 2020

Hi @lmtoo @schocco - this commit changes the signature of the delete method on the LockingAndVersioningRepository to match that of the CrudRepository. Its available from snapshot repository (1.0.0.M10-SNAPSHOT):

		<repository>
			<id>snapshots</id>
			<name>nexus</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>

Would one of you mind verifying if this fixes the issue, or not.

Many thanks.

@paulcwarren
Copy link
Owner

I think we have resolved this so I am going to close it. Please feel free to re-open if you find otherwise.

@schocco
Copy link

schocco commented Apr 22, 2020

Would one of you mind verifying if this fixes the issue, or not.

Many thanks.

I just tested with 1.0.0.M10 and can confirm that the issue is solved.

@paulcwarren
Copy link
Owner

Thanks @schocco. The confirmation is very much appreciated.

paulcwarren pushed a commit that referenced this issue Oct 27, 2021
- so tht downstream consumers dont see an erasure signature conflicts

Fixes #84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants