org.babyfish.jimmer.sql.ast.PropExpression 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;
import org.babyfish.jimmer.EmbeddableDto;
import org.babyfish.jimmer.View;
import org.babyfish.jimmer.meta.ImmutableProp;
import org.babyfish.jimmer.sql.ast.impl.CoalesceBuilder;
import org.babyfish.jimmer.sql.fetcher.Fetcher;
import org.jetbrains.annotations.NotNull;
public interface PropExpression extends Expression {
interface Str extends PropExpression, StringExpression {
@Override
@NotNull
StringExpression coalesce(String defaultValue);
@Override
@NotNull
StringExpression coalesce(Expression defaultExpr);
@Override
CoalesceBuilder.@NotNull Str coalesceBuilder();
}
interface Num> extends PropExpression, NumericExpression {
@Override
@NotNull
NumericExpression coalesce(N defaultValue);
@Override
@NotNull
NumericExpression coalesce(Expression defaultExpr);
@Override
CoalesceBuilder.@NotNull Num coalesceBuilder();
}
interface Cmp> extends PropExpression, ComparableExpression {
@Override
@NotNull
ComparableExpression coalesce(T defaultValue);
@Override
@NotNull
ComparableExpression coalesce(Expression defaultExpr);
@Override
CoalesceBuilder.@NotNull Cmp coalesceBuilder();
}
interface Embedded extends PropExpression {
> XE get(String prop);
> XE get(ImmutableProp prop);
Selection fetch(Fetcher fetcher);
> Selection fetch(Class dtoType);
@Override
default @NotNull Expression coalesce(T defaultValue) {
throw new UnsupportedOperationException("Embedded property does not support coalesce");
}
@Override
default @NotNull Expression coalesce(Expression defaultExpr) {
throw new UnsupportedOperationException("Embedded property does not support coalesce");
}
@Override
default @NotNull CoalesceBuilder coalesceBuilder() {
throw new UnsupportedOperationException("Embedded property does not support coalesce");
}
}
}