MENU

  /   Gegenereerde code van POJO voorbeeld

MetaFactory produceert code op basis van het pattern en model. Voor het modelobject Person deze java interface is created:

package com.firstbase.ba.example6a.pojo;

import java.util.Set;

/**
 * IPerson. Created by MetaFactory: Automation of Software Development
 *
 * @author - marnix
 */
public interface IPerson
{

  /**
   * Getter for property id.
   *
   * @return value of property id
   */
  public long getId();

  /**
   * Setter for property id.
   *
   * @param id new value of property id
   */
  public void setId(long id);

  /**
   * Getter for property firstName.
   *
   * @return value of property firstName
   */
  public String getFirstName();

  /**
   * Setter for property firstName.
   *
   * @param firstName new value of property firstName
   */
  public void setFirstName(String firstName);

  /**
   * Getter for property lastName.
   *
   * @return value of property lastName
   */
  public String getLastName();

  /**
   * Setter for property lastName.
   *
   * @param lastName new value of property lastName
   */
  public void setLastName(String lastName);

  /**
   * Getter for property homeAddress.
   *
   * @return value of property homeAddress
   */
  public IAddress getHomeAddress();

  /**
   * Setter for property homeAddress.
   *
   * @param homeAddress new value of property homeAddress
   */
  public void setHomeAddress(IAddress homeAddress);

  /**
   * Getter for property workAddress.
   *
   * @return value of property workAddress
   */
  public IAddress getWorkAddress();

  /**
   * Setter for property workAddress.
   *
   * @param workAddress new value of property workAddress
   */
  public void setWorkAddress(IAddress workAddress);

  /**
   * Getter for property phoneSet.
   *
   * @return value of property phoneSet
   */
  public Set<IPhone> getPhoneSet();

  /**
   * Setter for property phoneSet.
   *
   * @param phoneSet new value of property phoneSet
   */
  public void setPhoneSet(Set<IPhone> phoneSet);

  /**
   * addPhone - Utility method to add a object of type IPhone to phoneSet
   *
   * @param phone object to add to phoneSet
   */
  public void addPhone(IPhone phone);

  /**
   * deletePhone -
   *
   * @param phone
   */
  public void deletePhone(IPhone phone);

}

and the corresponding java class PersonImpl which implements the IPerson interface:

package com.firstbase.ba.example6a.pojo;

import java.util.HashSet;
import java.util.Set;

/**
 * PersonImpl - Created by MetaFactory: Automation of Software Development
 *
 * @author - marnix
 */
public class PersonImpl implements IPerson
{
  /** primary key */
  private long        id;

  private String      firstName;

  private String      lastName;

  private IAddress    homeAddress;

  private IAddress    workAddress;

  private Set<IPhone> phoneSet = new HashSet<IPhone>();

  /**
   * Getter for property id.
   *
   * @return value of property id
   */
  public long getId()
  {
    return this.id;
  }

  /**
   * Setter for property id.
   *
   * @param id new value of property id
   */
  public void setId(final long id)
  {
    this.id = id;
  }

  /**
   * Getter for property firstName.
   *
   * @return value of property firstName
   */
  public String getFirstName()
  {
    return this.firstName;
  }

  /**
   * Setter for property firstName.
   *
   * @param firstName new value of property firstName
   */
  public void setFirstName(final String firstName)
  {
    this.firstName = firstName;
  }

  /**
   * Getter for property lastName.
   *
   * @return value of property lastName
   */
  public String getLastName()
  {
    return this.lastName;
  }

  /**
   * Setter for property lastName.
   *
   * @param lastName new value of property lastName
   */
  public void setLastName(final String lastName)
  {
    this.lastName = lastName;
  }

  /**
   * Getter for property homeAddress.
   *
   * @return value of property homeAddress
   */
  public IAddress getHomeAddress()
  {
    return this.homeAddress;
  }

  /**
   * Setter for property homeAddress.
   *
   * @param homeAddress new value of property homeAddress
   */
  public void setHomeAddress(final IAddress homeAddress)
  {
    this.homeAddress = homeAddress;
  }

  /**
   * Getter for property workAddress.
   *
   * @return value of property workAddress
   */
  public IAddress getWorkAddress()
  {
    return this.workAddress;
  }

  /**
   * Setter for property workAddress.
   *
   * @param workAddress new value of property workAddress
   */
  public void setWorkAddress(final IAddress workAddress)
  {
    this.workAddress = workAddress;
  }

  /**
   * Getter for property phoneSet.
   *
   * @return value of property phoneSet
   */
  public Set<IPhone> getPhoneSet()
  {
    return this.phoneSet;
  }

  /**
   * Setter for property phoneSet.
   *
   * @param phoneSet new value of property phoneSet
   */
  public void setPhoneSet(final Set<IPhone> phoneSet)
  {
    this.phoneSet = phoneSet;
  }

  /**
   * addPhone -
   *
   * @param phone
   */
  public void addPhone(final IPhone phone)
  {
    phone.setPerson(this);
    phoneSet.add(phone);
  }

  /**
   * deletePhone -
   *
   * @param phone
   */
  public void deletePhone(final IPhone phone)
  {
    phone.setPerson(null);
    phoneSet.remove(phone);
  }

}