eszik.k
eszik.k

Reputation: 1781

'Specifications<T : Any!>' is deprecated. Deprecated in Java

My ide says 'Specifications<T : Any!>' is deprecated. Deprecated in Java. What should I use instead?

import org.springframework.data.jpa.domain.Specifications

fun hasName(name: String?): Specifications<User>? = name?.let{User::name.equal(it) }

Upvotes: 0

Views: 1325

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170919

since 2.0, use factory methods on Specification instead.

But here I think you just need to change the return type to Specification (which Specifications implements).

Upvotes: 1

Related Questions