⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 creditcardcompany.java

📁 Java EE 5 许多新功能都包含经过修补的 EJB 架构
💻 JAVA
字号:
/*
 * Copyright 2006 Borys Burnayev
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.rdacorp.petstore.domain;

import java.util.Collection;

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

/**
 * @author Borys Burnayev
 */
@Entity
@Table(name = "credit_card_company")
public class CreditCardCompany {

   private Integer creditCardCompanyId;

   private String code;

   private String name;

   public CreditCardCompany() {
   }

   public CreditCardCompany(String code, String name) {
      this.code = code;
      this.name = name;
   }

   @Id
   @Column(name = "credit_card_company_sysid")
   public Integer getCreditCardCompanyId() {
      return this.creditCardCompanyId;
   }

   public void setCreditCardCompanyId(Integer creditCardCompanyId) {
      this.creditCardCompanyId = creditCardCompanyId;
   }

   @Column(name = "credit_card_abbr")
   public String getCode() {
      return this.code;
   }

   public void setCode(String creditCardAbbr) {
      this.code = creditCardAbbr;
   }

   @Column(name = "credit_card_nm")
   public String getName() {
      return this.name;
   }

   public void setName(String name) {
      this.name = name;
   }

   public String toString() {
      String id = creditCardCompanyId != null ? creditCardCompanyId.toString() : "<no ID>";
      return "Credit Card Company " + id + ":\nCode: " + code + "\nName: " + name + "\n";
   }

   public boolean equals(Object object) {
      if (!(object instanceof CreditCardCompany))
         return false;
      CreditCardCompany creditCardCompany = (CreditCardCompany) object;
      return code.equals(creditCardCompany.getCode());
   }

   public int hashCode() {
      return code.hashCode();
   }

   public static CreditCardCompany findByID(Collection<CreditCardCompany> cccs, Integer cccID) {
      if (cccs != null) {
         for (CreditCardCompany ccc : cccs) {
            Integer id = ccc.getCreditCardCompanyId();
            if (id.equals(cccID)) {
               return ccc;
            }
         }
      }
      return null;
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -