0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SalesCubeでWarehouseServiceのメソッドをInputPOrderActionから呼び出す方法

Last updated at Posted at 2015-07-13

WarehouseService.java に下記のようなメソッドを定義する。

public List<BeanMap> ppiiyyoo() throws ServiceException {
	try {
		List<BeanMap> results = this.selectBySqlFile(BeanMap.class, 
			"yamato_sql/yamato.sql").getResultList();
		java.lang.System.out.println("yamatokenきーた: "+results);
		return results;
	} catch (Exception e) {
		throw new ServiceException(e);
	}				
} // function

このメソッドを InputPOrderAction.java から呼び出すには、下記のようにする。

import jp.co.arkinfosys.service.WarehouseService;

を宣言する。

@Resource
protected WarehouseService warehouseService;	

を宣言する。

warehouseService.ppiiyyoo();

のように呼び出す。

コンソールには下記のように表示される。

yamatokenきーた: [{id=1, name=kenichiro}, {id=2, name=harumi}, {id=3, name=makiko}, {id=4, name=shouji}]

なお、

List<BeanMap> yamatoke = warehouseService.ppiiyyoo();	
java.lang.System.out.println("yamatokenにーし: "+yamatoke);

のようにすると、コンソールには下記のように表示される。

yamatokenにーし: [{id=1, name=kenichiro}, {id=2, name=harumi}, {id=3, name=makiko}, {id=4, name=shouji}]
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?