[jOOQ/jOOQ#9879] Add explicit DataType::computedOnServer

This commit is contained in:
Lukas Eder 2022-06-14 12:46:19 +02:00
parent ddb55b5372
commit c04fb70369
2 changed files with 18 additions and 0 deletions

View File

@ -501,6 +501,19 @@ public interface DataType<T> extends Named {
*/
boolean computed();
/**
* Whether this column is computed on the server.
* <p>
* This is true only if all of these hold true:
* <ul>
* <li>{@link #computed()}</li>
* <li>{@link #generationLocation()} ==
* {@link GenerationLocation#SERVER}</li>
* <p>
* This feature is implemented in commercial distributions only.
*/
boolean computedOnServer();
/**
* Whether this column is computed on the client.
* <p>

View File

@ -170,6 +170,11 @@ implements
return generatedAlwaysAsGenerator() != null;
}
@Override
public final boolean computedOnServer() {
return computed() && generationLocation() == GenerationLocation.SERVER;
}
@Override
public final boolean computedOnClient() {
return computed() && generationLocation() == GenerationLocation.CLIENT;