[Seasar-user:13462] s2jdbc + s2flex2
李乐
[E-MAIL ADDRESS DELETED]
2008年 3月 28日 (金) 12:29:31 JST
ÀîS¤Ç¤¹¡£
¤¤¤Ä¤â¤ªÊÀԤˤʤäƤª¤ê¤Þ¤¹¡£
s2jdbcとs2flex2を聞ってサンプルプロジェクトを恬撹したいんですが、
ÒÔϤÎActionScript¥¨¥é©`¤¬°kÉú¤·¤Þ¤¤¤Þ¤·¤¿¡£
Error: Error #2030: ¥Õ¥¡¥¤¥ë¤Î½K¶Ë (EOF) ¤¬Ê³ö¤µ¤ì¤Þ¤·¤¿¡£
Entity:
Address.java
@Entity
public class Address {
@Id
@GeneratedValue
public Integer id;
public String name;
@Version
public Integer version;
}
Address.as:
package s2flex2.tutorial.entity {
[Bindable]
[RemoteClass(alias="s2flex2.tutorial.entity.Address")]
public class Address {
public var id: int;
public var name: String;
public var version: int;
}
}
AddressServiceImpl.java:
@RemotingService
public class AddressServiceImpl implements AddressService {
public JdbcManager jdbcManager;
public Address selectOne() {
List<Address> addressList =
jdbcManager.from(Address.class).getResultList();
return addressList != null ? addressList.get(0) : null;
}
}
addressPage.as:
[Bindable]
public class addressPage extends AbstractPage {
public var model: Address;
public var appMode: int;
override public function onCreationComplete(event: Event): void {
super.onCreationComplete(event);
setInitEntryMode();
selectOne();
}
public function setInitEntryMode(): void {
appMode = AppMode.NEUTRAL;
model = null;
}
public function setNewEntryMode(): void {
appMode = AppMode.NEW;
}
public function setCorEntryMode(): void {
appMode = AppMode.COR;
}
public function convertFormData(): void {
loadFormData(this.model);
}
public function selectOne():void {
remoteCall(service.selectOne(), selectOneOnSuccess, selectOneOnFault);
}
public function selectOneOnSuccess(e:ResultEvent, token:Object=null):void {
model = e.result as Address;
}
public function selectOneOnFault(e:FaultEvent, token:Object=null):void {
Alert.show("selectOne is fault");
}
}
h¾³£º¡¡seasar 2.4.22,Flex builder 3
Seasar-user メーリングリストの案内