vo层插入枚举类型

本文介绍了一个名为AdooriCampaign的Java类,该类用于管理广告活动的各种属性,包括目标人群ID、域名列表、关键词列表等,并定义了一个枚举类型Action来表示插入或删除操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

public class AdooriCampagin {

 protected int campaignTpId;
 protected int targetPopId;

 protected List domainList;
 protected List keywordList;
 protected List countryList;
 
 protected String domain;
 protected String keyword;
 
 protected int tpAdGroupKeywordId;
 protected int tpAdGroupDomainId;
 protected int tpAdGroupId;
 protected String country;
 protected String campaginUrl;
 protected int hourlyCap;
 protected AdooriCampagin.Action action;
 
 public enum Action {

  //INSERT 和 DELETE相当于Action类型,通过action.DELETE.value得到1

  INSERT((short) 1),
  DELETE((short) 2);

  protected final int value;

  Action(int value) {
   this.value = value;
  }

  public int getValue() {
   return value;
  }

  public static Action valueOf(int id) {
   for (Action t : Action.values()) {
    if (t.getValue() == id) {
     return t;
    }
   }
   return null;
  }
 }

 @Override
 public String toString() {
  final StringBuilder sb = new StringBuilder();
  sb.append("AdooriCampagin");
  sb.append(",campaignTpId=").append(campaignTpId);
  sb.append(",targetPopId=").append(targetPopId);
  sb.append(",tpAdGroupDomainId=").append(tpAdGroupDomainId);
  sb.append(",domainList=").append(domainList).append('/'');  
  sb.append(",tpAdGroupKeywordId=").append(tpAdGroupKeywordId);
  sb.append(",keywondList='").append(keywordList).append('/'');
  sb.append(",country=").append(country).append('/'');  
  sb.append(",campaginUrl='").append(campaginUrl).append('/'');
  sb.append(",hourlyCap=").append(hourlyCap);
  sb.append(",action=").append(action);
  sb.append('}');
  return sb.toString();
 }
 
 public void setTargetPopId(int targetPopId){
  this.targetPopId= targetPopId;
 }

 public int getTargetPopId(){
  return targetPopId;
 } 
 
 public void setAction(AdooriCampagin.Action action){
  this.action = action;
 }
 
 public AdooriCampagin.Action getAction(){
  return action;
 }

 public void setTpAdGroupId(int tpAdGroupId){
  this.tpAdGroupId= tpAdGroupId;
 }

 public int getTpAdGroupId(){
  return tpAdGroupId;
 }
 
 public void setTpAdGroupDomainId(int tpAdGroupDomainId){
  this.tpAdGroupDomainId= tpAdGroupDomainId;
 }

 public int getTpAdGroupDomainId(){
  return tpAdGroupDomainId;
 }
 
 public void setTpAdGroupKeywordId(int tpAdGroupKeywordId){
  this.tpAdGroupKeywordId= tpAdGroupKeywordId;
 }

 public int getTpAdGroupKeywordId(){
  return tpAdGroupKeywordId;
 }

 public void setCampaignTpId(int campaignTpId){
  this.campaignTpId= campaignTpId;
 }

 public int getCampaignTpId(){
  return campaignTpId;
 }

 public void setDomainList(List domainList){
  this.domainList= domainList;
 }

 public List getDomainList(){
  return domainList;
 }

 public void setKeywordList(List keywordList){
  this.keywordList= keywordList;
 }

 public List getKeywordList(){
  return keywordList;
 }

 public void setCountry(String country){
  this.country= country;
 }

 public String getCountry(){
  return country;
 }

 public void setCampaginUrl(String campaginUrl){
  this.campaginUrl= campaginUrl;
 }

 public String getCampaginUrl(){
  return campaginUrl;
 }

 public void setHourlyCap(int hourlyCap){
  this.hourlyCap= hourlyCap;
 }

 public int getHourlyCap(){
  return hourlyCap;
 }
 
 public void setDomain(String domain){
  this.domain= domain;
 }

 public String getDomain(){
  return domain;
 }

 public void setKeyword(String keyword){
  this.keyword= keyword;
 }

 public String getKeyword(){
  return keyword;
 }

 public void setCountryList(List countryList){
  this.countryList= countryList;
 }

 public List getCountryList(){
  return countryList;
 }
}

在中,POVO都是用来表示对象的特定类型。PO代表持久对象(Persistant Object),它是与数据库中的表相映射的Java对象。一个PO对象通常对应数据库中的一条记录,多个记录可以使用PO的集合来表示。PO对象应该只包含对数据库的操作方法,而不包含具体的业务逻辑。它通常遵循Java Bean的规范,拥有getter和setter方法。 VO代表值对象(Value Object),它用于表示一个与前端进行交互的Java对象。VO对象只包含前端需要展示的数据,而不包含与业务逻辑相关的操作。通常为了减少传输数据量和保护数据库结构的安全性,VO对象不会包含一些不必要的字段,比如数据创建和修改的时间等。VO对象也遵循Java Bean的规范,拥有getter和setter方法。 总结来说,PO主要用于与数据库的交互,而VO主要用于前端展示和交互。在设计架构时,PO对象负责数据持久化,VO对象负责数据展示。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Java开发各对象含义 PO,VO,DAO,BO,POJO](https://blog.youkuaiyun.com/oooo2316/article/details/104842651)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值