Closed BrettCao closed 4 years ago
What is the problem with that? Refactor adding a function ... will add the body braces etc.
Missing body braces now
Yes that is correct and intended.
So what is the problem? Are you unable to compile or something?
Yes,If missing {}: Error:(14, 30) Kotlin: Unresolved reference: db
Unable to compile
This doesn't really make sense to me. Show me all the code for the file/class that is unable to compile. Does it not contain a method that you added? When you added it you didn't add the brackets for the body for some reason?
Missing “{}” when auto-generated Finder, now need to be manually added to compile
@Override public void finderClass(FileWriter writer, String shortName, String idTypeShortName) throws IOException {
//open class AddressFinder : Finder<Long, Address>(Address::class.java)
writer.append("open class ").append("").append(shortName).append("Finder")
.append(" : Finder<").append(idTypeShortName).append(", ")
.append(shortName).append(">(").append(shortName).append("::class.java)")
.append(NEWLINE);
}
to
@Override public void finderClass(FileWriter writer, String shortName, String idTypeShortName) throws IOException {
//open class AddressFinder : Finder<Long, Address>(Address::class.java)
writer.append("open class ").append("").append(shortName).append("Finder")
.append(" : Finder<").append(idTypeShortName).append(", ")
.append(shortName).append(">(").append(shortName).append("::class.java){")
.append(NEWLINE);
}
@Override public void finderClassEnd(FileWriter writer) throws IOException { writer.append("}").append(NEWLINE); }
Yeah, I still don't understand.
I think you are saying
open class AddressFinder : Finder<Long, Address>(Address::class.java)
The above does not compile. For me it does compile, it is valid Kotlin.
I think this issue is likely to be the same as https://github.com/ebean-orm-tools/finder-generator/pull/30
So I guess we can close this.
Lack of body open class UserFinder : Finder<Long, User>(User::class.java) { } ....