我正在创建动态输入字段,它将接受所有类型值。我只需要限制输入的数字。
模板:
<tr *ngFor="let item of rowData">
<ng-container *ngFor="let hitem of columnDefs" >
<td *ngIf="!hitem.dropdown; else selectDrop">
<span *ngIf="hitem.edit;else content">
<div *ngIf="editing">
<input [required]="required" [name]="item[hitem.field]" [(ngModel)]="item[hitem.field]" />
</div>
<div *ngIf="!editing">
{{item[hitem.field]}}
</div>
</span>
<ng-template #content>content here... {{item[hitem.field]}} </ng-template>
</td>
<ng-template #selectDrop>
<td>
<select [(ngModel)]="item[hitem.field]">
<option *ngFor="let item of aplAry">{{item}}</option>
</select>
</td>
</ng-template>
</ng-container>
</tr>
Run Code Online (Sandbox Code Playgroud)
数据:
mainHead = [{name:'', colspan:1}, {name:'Deatils', colspan:2}]
columnDefs = [
{headerName: 'Make', field: 'make', edit:true },
{headerName: 'Model', field: 'model', dropdown: true },
{headerName: 'Price', field: …Run Code Online (Sandbox Code Playgroud) 我是 JPA/Hibernate 一级缓存的新手。
我有以下存储库类
每次我调用 findByState 方法时(在同一个事务中),我都会看到 hibernate sql 查询被输出到控制台
public interface PersonRepository extends JpaRepository<PersonEntity, id> {
@Query("select person from PersonEntity p where name= (?1)")
List<PersonEntity> findByState(String state);
....
}
Run Code Online (Sandbox Code Playgroud)
我希望结果被一级缓存缓存,数据库不会被重复查询。
我究竟做错了什么?