flex 前后台类的传递

阅读更多

前台的as 类:最重要的是要加com.system.domain.FlowType以便前台的类和后台的类对应。

package
{
	
	/**
	 * 描述:
	 * 创建时间:2012-12-26 上午10:09:29 
	 */
	[ Bindable]
	[ RemoteClass( alias= "com.system.domain.FlowType")]
	public class FlowType
	{
		public function FlowType()
		{
		}
		
		
		private var _pkId:int;
		private var _flowId:int;
		private var _typeId:int;
		
		
		
		public function get typeId():int
		{
			return _typeId;
		}

		public function set typeId(value:int):void
		{
			_typeId = value;
		}

		public function get flowId():int
		{
			return _flowId;
		}

		public function set flowId(value:int):void
		{
			_flowId = value;
		}

		public function get pkId():int
		{
			return _pkId;
		}

		public function set pkId(value:int):void
		{
			_pkId = value;
		}

	}
}

  前台的代码:



	
		
	
	
		
	
	
		
	
	
		
		
			
				
				
				
			
		
		

 

后台对应的类:

ackage com.system.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table (name = "flow_type")
public class FlowType implements Serializable {

	private Integer pkId;
	private Integer flowId;
	private Integer typeId;


	// empty Constructor
	public FlowType(){
	super();
	}

	// full Constructor
	public FlowType(Integer pkId , Integer flowId , Integer typeId){
		super();
		this.pkId = pkId;
		this.flowId = flowId;
		this.typeId = typeId;
	}

	// auto Constructor
	public FlowType(Integer flowId , Integer typeId){
		super();
		this.flowId = flowId;
		this.typeId = typeId;
	}

	@Id
	@GeneratedValue
	@Column(name = "pk_id")
	public Integer getPkId() { 
		return pkId ;
	}

	public void setPkId( Integer pkId ) { 
		this.pkId = pkId;
	}

	@Column(name = "flow_id")
	public Integer getFlowId() { 
		return flowId ;
	}

	public void setFlowId( Integer flowId ) { 
		this.flowId = flowId;
	}

	@Column(name = "type_id")
	public Integer getTypeId() { 
		return typeId ;
	}

	public void setTypeId( Integer typeId ) { 
		this.typeId = typeId;
	}

}
 

后台与前台的交互类:

package com.system.action;

import java.util.List;

import javax.annotation.Resource;

import com.system.domain.FlowType;
import com.system.service.FlowTypeService;

public class WorkflowAction {

       private FlowTypeService flowTypeService;

       public FlowTypeService getFlowTypeService() {
             return flowTypeService;
      }
      
       @Resource
       public void setFlowTypeService(FlowTypeService flowTypeService) {
             this. flowTypeService = flowTypeService;
      }
      
      
       public  List   findFlowTypes()
      {
             return flowTypeService.findFlowTypes();
      }
      
       public void saveFlowTypes(FlowType ty)
      {
            System. out.println(ty.getFlowId());
            System. out.println(ty.getPkId());
      }
      
}

 配置文件:


		
	

你可能感兴趣的:(flex,java)