我想检查方法中的空值
@Override
public void updateFooFromNonNullAttributesOfDto(FooDto fooDto, Foo foo) {
if ( fooDto== null ) {
return;
}
if ( fooDto.getBar() != null ) {
site.setBar( fooDto.getBar() );
}
if ( fooDto.getBaz() != null ) {
site.setBar( fooDto.getBaz() );
}
}
Run Code Online (Sandbox Code Playgroud)
当我使用
@Mapper( NullValueCheckStrategy.ALWAYS)
Run Code Online (Sandbox Code Playgroud)
它检查所有方法,但我只想检查一种......如何解决这个问题?
我有Kotlin界面
interface FileSystem {
suspend fun getName(path: Path): List<String>
}
Run Code Online (Sandbox Code Playgroud)
我怎么能用Java调用它?什么是
Continuation <? super List<String>>
Run Code Online (Sandbox Code Playgroud)
你能告诉我这些警告与什么有关吗?
Swagger 扫描包裹。到目前为止,并不是所有的类型都被标注了注释
14:48:29,682 INFO [stdout] (ServerService Thread Pool -- 10) 2017-09-21 14:48:29 DEBUG ModelConverterContextImpl:75 - resolveProperty [simple type, class java.lang.String]
14:48:29,683 INFO [stdout] (ServerService Thread Pool -- 10) 2017-09-21 14:48:29 DEBUG ModelResolver:94 - Can't check class [simple type, class java.lang.String], java.lang.String
14:48:29,683 INFO [stdout] (ServerService Thread Pool -- 10) 2017-09-21 14:48:29 DEBUG ModelResolver:119 - resolveProperty [simple type, class java.lang.String]
14:48:29,683 INFO [stdout] (ServerService Thread Pool -- 10) 2017-09-21 14:48:29 DEBUG ModelConverterContextImpl:75 - resolveProperty [simple type, class java.lang.String]
14:48:29,683 INFO …Run Code Online (Sandbox Code Playgroud) 如何正确使用带有日期间隔的查询
@SqlUpdate("delete fromlogin where created < now() - ':days days' :: interval")
void deleteOldLogin(@Bind("days") Period days);
Run Code Online (Sandbox Code Playgroud) 我如何在何处创建动态
public interface ThingDAO {
@SqlQuery("SELECT * FROM things <where>)
List<Thing> findThingsWhere(@Define("where") String where);
}
Run Code Online (Sandbox Code Playgroud)
JDBI 如何在防止 SQL 注入的同时动态创建 WHERE 子句?
但它实际上并不适用于 JDBI3
我的项目结构如
-parent
--web
--server
----moduleA
----moduleB
----module?
----main
Run Code Online (Sandbox Code Playgroud)
我的父母 pom.xml
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly-maven-plugin.version}</version>
<configuration>
<hostname>${wildfly-hostname}</hostname>
<port>${wildfly-port}</port>
<username>${wildfly-username}</username>
<password>${wildfly-password}</password>
<!-- <filename>${project.build.directory}/${project.build.finalName}.${project.packaging}</filename> ?? -->
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
我只想部署来自 mweb 模块的 WAR 和来自主模块的 EAR 但现在部署所有 jar 等
我必须如何配置我的 Maven?
告诉我如何正确配置Feign和Spring Pageable的工作这里是我的Feign设置
feign:
okhttp:
enabled: true
autoconfiguration:
jackson:
enabled: true
client:
config:
default:
connectTimeout: ${FEIGN_DEFAULT_CONNECT_TIMEOUT:10000}
readTimeout: ${FEIGN_DEFAULT_READ_TIMEOUT:60000}
loggerLevel: full
errorDecoder: ru.core.config.TokenErrorDecoder
retryer: ru.service.SudisTokenService
Run Code Online (Sandbox Code Playgroud)
我的假客户
@FeignClient(name = "BaseCaseFeignClient", url = "${feign.services.host-backend.url}")
public interface BaseCaseFeignClient {
@GetMapping("/api/cases/base")
Page<BaseCaseEntityDto> getBaseCases(@SpringQueryMap BaseCaseEntityFilter filter, Pageable pageable);
@PostMapping("/api/cases/base/search")
Page<FoundRecordDto> searchCases(@RequestBody FilterSpecification filter, @SpringQueryMap Pageable pageable);
}
Run Code Online (Sandbox Code Playgroud)
获取请求工作正常。发布请求时出现问题。我收到以下错误
"No property caseOpenDttm: DESC found for type BaseCaseEntity!"
Run Code Online (Sandbox Code Playgroud)
在这种情况下,该项目根本不会被组装。
Page<FoundRecordDto> searchCases(@RequestBody FilterSpecification filter, Pageable pageable);
Caused by: java.lang.IllegalStateException: Method has too many Body parameters: public abstract org.springframework.data.domain.Page ru..BaseCaseFeignClient.searchCases(ru.ilter.shared.basecase.search.FilterSpecification,org.springframework.data.domain.Pageable)
Warnings: …Run Code Online (Sandbox Code Playgroud) CSSResource 接口
public interface AppResources extends ClientBundle {
public static final AppResources INSTANCE = GWT.create(AppResources.class);
interface Style extends CssResource {
String login();
}
@Source("css/style.gss")
Style style();
@Source("images/logo.png")
ImageResource logo();
}
Run Code Online (Sandbox Code Playgroud)
样式
.login {
width: 100%;
height: 100%;
}
.login .panel-body {
text-align: center;
}
.login .loginWrapper {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.login .input-group {
padding-bottom: 10px;
width: 300px;
}
.login .input-group-addon {
width: 100px;
}
Run Code Online (Sandbox Code Playgroud)
当您尝试编译时出现错误
[错误] 严格的 CssResource 中存在以下未混淆的类:panel-body。通过向混淆类的 CssResource 接口添加字符串访问器方法来修复,或对未混淆类使用 @external …
我在父母POM中宣布
<dependencyManagement>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
<scope>compile</scope>
</dependency>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)
此外,孩子使用pom
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
</dependencies>
Run Code Online (Sandbox Code Playgroud)
一切正常吗?但是当我使用type = pom的这种依赖时
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-7.0</artifactId>
<version>${jboss-javaee-7.0.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencyManagement>
Run Code Online (Sandbox Code Playgroud)
我有错误
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project by.services:by.utils:1.0.2 (D:\Work\V2_Change_Maven_Structure\by.utils\pom.xml) has 1 error
[ERROR] 'dependencies.dependency.version' for org.jboss.spec:jboss-javaee-7.0:jar is missing. @ line 18, column 21
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run …Run Code Online (Sandbox Code Playgroud) java ×5
jdbi ×2
maven ×2
css ×1
dependencies ×1
feign ×1
gwt ×1
kotlin ×1
mapstruct ×1
postgresql ×1
spring ×1
spring-boot ×1
spring-data ×1
swagger ×1
wildfly ×1