org.babyfish.jimmer.sql.ast.query.Example Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.sql.ast.query;
import org.babyfish.jimmer.View;
import org.babyfish.jimmer.lang.NewChain;
import org.babyfish.jimmer.meta.TypedProp;
import org.babyfish.jimmer.sql.ast.LikeMode;
import org.babyfish.jimmer.sql.ast.impl.ExampleImpl;
public interface Example {
static Example of(E obj) {
if (obj instanceof View>) {
throw new IllegalArgumentException(
"entity cannot be view, " +
"please call another overloaded function whose parameter is view"
);
}
return new ExampleImpl<>(obj);
}
static Example of(View view) {
return new ExampleImpl<>(view.toEntity());
}
@NewChain
Example match(MatchMode mode);
@NewChain
Example match(TypedProp prop, MatchMode matchMode);
@NewChain
Example trim();
@NewChain
Example trim(TypedProp.Scalar prop);
@NewChain
default Example like(TypedProp.Scalar prop) {
return like(prop, LikeMode.ANYWHERE);
}
@NewChain
Example like(TypedProp.Scalar prop, LikeMode likeMode);
@NewChain
default Example ilike(TypedProp.Scalar prop) {
return ilike(prop, LikeMode.ANYWHERE);
}
@NewChain
Example ilike(TypedProp.Scalar prop, LikeMode likeMode);
@NewChain
Example ignoreZero(TypedProp.Scalar prop);
enum MatchMode {
NOT_EMPTY,
NOT_NULL,
NULLABLE
}
}