mirror of
https://github.com/dalbodeule/snap-admin.git
synced 2025-06-09 05:48:20 +00:00
0.0.2 README
This commit is contained in:
parent
9391db1ae9
commit
06d5916021
30
README.md
30
README.md
@ -59,32 +59,32 @@ The following annotations are supported.
|
|||||||
|
|
||||||
### @DisplayName
|
### @DisplayName
|
||||||
```
|
```
|
||||||
@DisplayName
|
@DisplayName
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
To show an item in a table its primary key is used by default. If you set a method as `@DisplayName` in your `@Entity` class, this result will be shown in addition to its primary key wherever possible.
|
To show an item in a table its primary key is used by default. If you set a method as `@DisplayName` in your `@Entity` class, this result will be shown in addition to its primary key wherever possible.
|
||||||
|
|
||||||
### @DisplayFormat
|
### @DisplayFormat
|
||||||
```
|
```
|
||||||
@DisplayFormat(format = "$%.2f")
|
@DisplayFormat(format = "$%.2f")
|
||||||
private Double price;
|
private Double price;
|
||||||
```
|
```
|
||||||
|
|
||||||
Specify a format to apply when displaying the field.
|
Specify a format to apply when displaying the field.
|
||||||
|
|
||||||
### @ComputedColumn
|
### @ComputedColumn
|
||||||
```
|
```
|
||||||
@ComputedColumn
|
@ComputedColumn
|
||||||
public double totalSpent() {
|
public double totalSpent() {
|
||||||
double total = 0;
|
double total = 0;
|
||||||
for (Order o : orders) {
|
for (Order o : orders) {
|
||||||
total += o.total();
|
total += o.total();
|
||||||
}
|
|
||||||
return total;
|
|
||||||
}
|
}
|
||||||
|
return total;
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Add an extra field that's computed at runtime instead of a database column. It will be displayed everywhere as a normal, read-only column.
|
Add an extra field that's computed at runtime instead of a database column. It will be displayed everywhere as a normal, read-only column.
|
||||||
@ -92,8 +92,8 @@ Add an extra field that's computed at runtime instead of a database column. It w
|
|||||||
### @Filterable
|
### @Filterable
|
||||||
|
|
||||||
```
|
```
|
||||||
@Filterable
|
@Filterable
|
||||||
private LocalDate createdAt;
|
private LocalDate createdAt;
|
||||||
```
|
```
|
||||||
|
|
||||||
Place on one or more fields in a class to activate the faceted search feature. This will allow you to easily combine all these filters when operating on this table.
|
Place on one or more fields in a class to activate the faceted search feature. This will allow you to easily combine all these filters when operating on this table.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user