TaintedS bookSlug = rP.urlTokens().get(1);
EbeanServer ebeanServer = Ebean.getServer(null);
Book book = ebeanServer.find(Book.class)
.where().eq("slug", bookSlug)
.findUnique();
class Book(@Column var title:TaintedS,
@Column var titleLong:TaintedS,
@Column var subTitle: TaintedS? = null,
@Column var slug: TaintedS) : Deletable() {
public class TaintedS implements Comparable<TaintedS>, Serializable {
private static final long serialVersionUID = 20130917223500L;
private final String s;
/**
EBean seems to want this to be public even though Josh Bloch isn't
into public constructors.
@param str the string to wrap
*/
public TaintedS(String str) { s = str; }
/**
Using this trusts user input, defeating the purpose of this class.
This is deprecated so you don't do so accidentally.
It uses warning signs as delimiters in case you do anyway!
*/
@Deprecated
public String toString() {
// ⛔ No Entry (road sign) - always bold and easy to see everywhere. Often red. 2017-01-27.
return "⛔" + s + "⛔";
}
@Override
public int hashCode() {
// It is critically important (for comparing to Strings) that this be 100% compatable with
// string.hashcode(). Don't get cute adding random stuff to make it different.
return s.hashCode();
}
@Override
public boolean equals(Object other) {
if (this == other) { return true; }
if ( !(other instanceof TaintedS) ) { return false; }
final TaintedS that = (TaintedS) other;
return this.s.equals(that.s);
}
}
List<Book> books = ebeanServer.find(Book.class)
.orderBy().asc("title")
.findList();
<plugin>
<groupId>org.avaje.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>8.2.1</version>
<executions>
<execution>
<id>main</id>
<phase>process-classes</phase>
<configuration>
<transformArgs>debug=1</transformArgs>
</configuration>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>
@Entity
@Table(uniqueConstraints = arrayOf(UniqueConstraint(columnNames = arrayOf("fileName"))))
class Chapter(@Column var name: TaintedS,
@Column var fileName:TaintedS?) : Deletable() {
@Column var free:Boolean = false
So check your code and all dependencies if there are refenrences to com.avaje.ebean
cheers
Roland
--
---
You received this message because you are subscribed to the Google Groups "Ebean ORM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ebean+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.