我不明白为什么我会收到错误.我的地图没有改变.
检查后表情发生了变化.上一个值:'[object Map Iterator]'.当前值:'[object Map Iterator]'
<tr *ngFor="let author of bindedAuthors.keys()">
<td> {{author}}</td>
<td>
<button (click)="onUpdate(author)"
class="btn gl-btn-primary">Update
</button>
</td>
<td>
<button (click)="onDelete(author)" class="btn gl-btn-default">Delete</button>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
结果是预期的,所有数据都会显示,但每次都会出现这个错误.
是否可以使用最新的 swagger 3 版本在响应模型中显示而不仅仅是一个响应类。我想显示所有可能的变体(例如,可以响应 3 个可能的子类 - 不仅是基类或子类之一)。我认为,有很多情况会返回多态响应。我有这样的情况,但我无法使用 java 注释在 swagger-UI 中记录它。我尝试了带有子类型和父参数器的 @ApiModel ,但这对 UI 没有影响。我在 GitHub 上看到了很多关于我的问题的错误和问题,但仍然没有找到任何示例如何使它成为可能。
我试图通过将第二个参数传递给具有列表大小的方法来避免冗余。相反,我使用 EL,但出现错误:
org.hibernate.QueryException:并非所有命名参数都已设置:[ $synthetic$__1] [SELECT unique b FROM Book b join b.bookHashtags as ht where ht.hashtagName in :tags group by b.uniqueIdentifier has count(ht.唯一标识符) = : $synthetic$__1]
@Repository
public interface BookRepository extends JpaRepository<Book, Long>, JpaSpecificationExecutor<Book> {
@Query("SELECT distinct b FROM Book b join b.bookHashtags as ht where ht.hashtagName in :tags " +
"group by b.uniqueIdentifier having count(ht.uniqueIdentifier) = :#{#tags.size()}")
List<Book> findAllBooksContainedTags(@Param("tags") Set<String> tags);
}
Run Code Online (Sandbox Code Playgroud)
我使用 spring-data-jpa 1.11.0.RELEASE。我知道这个功能是在1.4版本中开发的。为什么它在我的情况下不起作用......
我对Java的字符串池有一些了解。网络中的所有示例都明确地创建了变量。但是,如果我从方法返回硬编码的字符串,将会发生什么。是使用字符串池还是为每个方法调用一次又一次创建字符串。我找不到有关此案的任何信息。
我有这样的例子:
public class TestService {
@Override
protected Optional<String> getPayTypeCode() {
return Optional.of("LDV");
}
//...
}
Run Code Online (Sandbox Code Playgroud)
常量示例:
public class TestService {
private static final String PAY_CODE = "LDV";
@Override
protected Optional<String> getPayTypeCode() {
return Optional.of(PAY_CODE);
}
//...
}
Run Code Online (Sandbox Code Playgroud)
我想知道,我的第一种情况是使用字符串池吗?哪种情况会更快?
java ×3
angular ×1
annotations ×1
hibernate ×1
spring ×1
spring-el ×1
springfox ×1
string-pool ×1
swagger ×1
swagger-ui ×1
typescript ×1