3 回答

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超9個(gè)贊
您應(yīng)該在聯(lián)接器轉(zhuǎn)換中加入兩個(gè)表。使用 Left(master) outer join 然后將其帶入目標(biāo)。然后將右表中的 BETRG 列映射到目標(biāo)以及左表中的其余列。發(fā)生的情況是,當(dāng)沒(méi)有匹配項(xiàng)時(shí),BETRG 將為空。將其放入表達(dá)式中,查看該值是否為 null 或空,然后將其更改為 0 或您想要的值。

TA貢獻(xiàn)1834條經(jīng)驗(yàn) 獲得超8個(gè)贊
我想測(cè)試一個(gè)簡(jiǎn)單關(guān)閉應(yīng)用程序的類:
@Component
public class ShutdownManager {
@Autowired
private ApplicationContext applicationcontext;
public int shutdown(int returnCode) {
return SpringApplication.exit(applicationcontext, () -> returnCode);
}
}
我創(chuàng)建的測(cè)試用例是這樣的:
public class ShutdownManagerTest {
@Test
public void should_shutdown_gracefully() {
SpringApplication app = new SpringApplication(TestClass.class);
ConfigurableApplicationContext context = app.run();
ShutdownManager shutdownManager = (ShutdownManager)context.getBean("shutdownManager");
int result = shutdownManager.shutdown(10);
assertThat(result).isEqualTo(10);
}
@SpringBootApplication
@ImportResource("classpath:/core/shutdownmanagertest.xml")
private static class TestClass {
public TestClass() {
}
public static void main(String[] args) {
}
}
}
我的 shutdownmanagertest.xml 只包含一個(gè) bean:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="shutdownManager" class="com.mycodebase.ShutdownManager" />
</beans>
但是,當(dāng)我運(yùn)行它時(shí),它會(huì)抱怨:
Field myOtherService in com.mycodebase.MyTask required a bean of type 'com.mycodebase.MyOtherService ' that could not be found.
MyTask 類位于 ShutdownManager 的同一個(gè)包中,其中包含一個(gè)字段 myOtherService,該字段具有 @Autowire 注釋。但它沒(méi)有在我的測(cè)試 xml 中定義,它只包含一個(gè) bean。
有人可以幫助我理解為什么它會(huì)嘗試解析不在上下文中的 bean 嗎?
爪哇春天彈簧靴

TA貢獻(xiàn)1757條經(jīng)驗(yàn) 獲得超7個(gè)贊
這是有效的:
import java.util.*;
private ArrayList<String> myList2 = new ArrayList<String>();
QUALF_out = QUALF;
BETRG_out = BETRG;
SegmentNumber_out = SegmentNumber;
DOCNUM = DOCNUM;
array_for_search = QUALF + ParentSegmentNumber + DOCNUM ;
myList2.add(array_for_search);
System.out.println("myList: " + myList2);
System.out.println("Array: " + myList2.contains("910" + ParentSegmentNumber + DOCNUM));
if(!myList2.contains("910" + ParentSegmentNumber + DOCNUM)){
QUALF_out="910";
BETRG_out="0";
}
generateRow();
添加回答
舉報(bào)