Model.Finder<I, T> Deperecated Play! 2.4
Asked Answered
B

3

11

I am building an application using the latest version of Play!. When defining a Finder( as in Model.Finder) my IDE gives me a warning Finder is deprecated. I can't find any information in the documentation about Model.Finder being deprecated of any alternative to using it. Has anyone experienced a similar issue and know of an alternative?

Blurt answered 10/6, 2015 at 16:4 Comment(0)
B
13

According to github Model.Finder is not deprecated, but one of its constructors:

/**
 * @deprecated
 */
public Finder(Class<I> idType, Class<T> type) {
  super(null, type);
}

Make sure you use correct constructor, pointed out by @biesior:

public static Finder<Long, Foo> find = new Finder<>(Foo.class);
Bazooka answered 10/6, 2015 at 16:21 Comment(0)
F
18

Use Model.Finder<T> like:

public static Finder<Long, Foo> find = new Finder<>(Foo.class);

instead of

public static Finder<Long, Foo> find = new Finder<>(Long.class, Foo.class);
Fuentes answered 10/6, 2015 at 18:18 Comment(0)
B
13

According to github Model.Finder is not deprecated, but one of its constructors:

/**
 * @deprecated
 */
public Finder(Class<I> idType, Class<T> type) {
  super(null, type);
}

Make sure you use correct constructor, pointed out by @biesior:

public static Finder<Long, Foo> find = new Finder<>(Foo.class);
Bazooka answered 10/6, 2015 at 16:21 Comment(0)
I
0

Try This

 public static Finder<Long, Foo> find = new Finder<>(Foo.class);
Inefficient answered 20/10, 2016 at 7:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.