Advertisement
Guest User

Untitled

a guest
May 2nd, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.23 KB | None | 0 0
  1. //
  2. // Source code recreated from a .class file by IntelliJ IDEA
  3. // (powered by Fernflower decompiler)
  4. //
  5.  
  6. package eu.nimble.service.model.ubl.commonaggregatecomponents;
  7.  
  8. import eu.nimble.service.model.ubl.commonaggregatecomponents.ClauseTypeNoteItem;
  9. import eu.nimble.service.model.ubl.commonaggregatecomponents.DataMonitoringClauseType;
  10. import eu.nimble.service.model.ubl.commonaggregatecomponents.DocumentClauseType;
  11. import java.io.Serializable;
  12. import java.util.ArrayList;
  13. import java.util.List;
  14. import javax.persistence.Basic;
  15. import javax.persistence.CascadeType;
  16. import javax.persistence.Column;
  17. import javax.persistence.Entity;
  18. import javax.persistence.GeneratedValue;
  19. import javax.persistence.GenerationType;
  20. import javax.persistence.Id;
  21. import javax.persistence.Inheritance;
  22. import javax.persistence.InheritanceType;
  23. import javax.persistence.JoinColumn;
  24. import javax.persistence.OneToMany;
  25. import javax.persistence.Table;
  26. import javax.persistence.Transient;
  27. import javax.xml.bind.annotation.XmlAccessType;
  28. import javax.xml.bind.annotation.XmlAccessorType;
  29. import javax.xml.bind.annotation.XmlAttribute;
  30. import javax.xml.bind.annotation.XmlElement;
  31. import javax.xml.bind.annotation.XmlSeeAlso;
  32. import javax.xml.bind.annotation.XmlType;
  33. import org.jvnet.hyperjaxb3.item.ItemUtils;
  34. import org.jvnet.jaxb2_commons.lang.Equals;
  35. import org.jvnet.jaxb2_commons.lang.EqualsStrategy;
  36. import org.jvnet.jaxb2_commons.lang.JAXBEqualsStrategy;
  37. import org.jvnet.jaxb2_commons.locator.ObjectLocator;
  38. import org.jvnet.jaxb2_commons.locator.util.LocatorUtils;
  39.  
  40. @XmlAccessorType(XmlAccessType.FIELD)
  41. @XmlType(
  42.     name = "ClauseType",
  43.     propOrder = {"id", "note", "type"}
  44. )
  45. @XmlSeeAlso({DataMonitoringClauseType.class, DocumentClauseType.class})
  46. @Entity(
  47.     name = "ClauseType"
  48. )
  49. @Table(
  50.     name = "CLAUSE_TYPE"
  51. )
  52. @Inheritance(
  53.     strategy = InheritanceType.JOINED
  54. )
  55. public class ClauseType implements Serializable, Equals {
  56.     private static final long serialVersionUID = 1L;
  57.     @XmlElement(
  58.         name = "ID",
  59.         namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",
  60.         required = true
  61.     )
  62.     protected String id;
  63.     @XmlElement(
  64.         name = "Note",
  65.         namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
  66.     )
  67.     protected List<String> note;
  68.     @XmlElement(
  69.         name = "Type",
  70.         namespace = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2",
  71.         required = true
  72.     )
  73.     protected String type;
  74.     @XmlAttribute(
  75.         name = "Hjid"
  76.     )
  77.     protected Long hjid;
  78.     protected transient List<ClauseTypeNoteItem> noteItems;
  79.  
  80.     public ClauseType() {
  81.     }
  82.  
  83.     @Basic
  84.     @Column(
  85.         name = "ID",
  86.         length = 255
  87.     )
  88.     public String getID() {
  89.         return this.id;
  90.     }
  91.  
  92.     public void setID(String value) {
  93.         this.id = value;
  94.     }
  95.  
  96.     @Transient
  97.     public List<String> getNote() {
  98.         if(this.note == null) {
  99.             this.note = new ArrayList();
  100.         }
  101.  
  102.         return this.note;
  103.     }
  104.  
  105.     public void setNote(List<String> note) {
  106.         this.note = note;
  107.     }
  108.  
  109.     @Basic
  110.     @Column(
  111.         name = "TYPE_",
  112.         length = 255
  113.     )
  114.     public String getType() {
  115.         return this.type;
  116.     }
  117.  
  118.     public void setType(String value) {
  119.         this.type = value;
  120.     }
  121.  
  122.     public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
  123.         if(object != null && this.getClass() == object.getClass()) {
  124.             if(this == object) {
  125.                 return true;
  126.             } else {
  127.                 ClauseType that = (ClauseType)object;
  128.                 String lhsType = this.getID();
  129.                 String rhsType = that.getID();
  130.                 if(!strategy.equals(LocatorUtils.property(thisLocator, "id", lhsType), LocatorUtils.property(thatLocator, "id", rhsType), lhsType, rhsType)) {
  131.                     return false;
  132.                 } else {
  133.                     List lhsType1 = this.note != null && !this.note.isEmpty()?this.getNote():null;
  134.                     List rhsType1 = that.note != null && !that.note.isEmpty()?that.getNote():null;
  135.                     if(!strategy.equals(LocatorUtils.property(thisLocator, "note", lhsType1), LocatorUtils.property(thatLocator, "note", rhsType1), lhsType1, rhsType1)) {
  136.                         return false;
  137.                     } else {
  138.                         lhsType = this.getType();
  139.                         rhsType = that.getType();
  140.                         return strategy.equals(LocatorUtils.property(thisLocator, "type", lhsType), LocatorUtils.property(thatLocator, "type", rhsType), lhsType, rhsType);
  141.                     }
  142.                 }
  143.             }
  144.         } else {
  145.             return false;
  146.         }
  147.     }
  148.  
  149.     public boolean equals(Object object) {
  150.         EqualsStrategy strategy = JAXBEqualsStrategy.INSTANCE;
  151.         return this.equals((ObjectLocator)null, (ObjectLocator)null, object, strategy);
  152.     }
  153.  
  154.     @Id
  155.     @Column(
  156.         name = "HJID"
  157.     )
  158.     @GeneratedValue(
  159.         strategy = GenerationType.AUTO
  160.     )
  161.     public Long getHjid() {
  162.         return this.hjid;
  163.     }
  164.  
  165.     public void setHjid(Long value) {
  166.         this.hjid = value;
  167.     }
  168.  
  169.     @OneToMany(
  170.         targetEntity = ClauseTypeNoteItem.class,
  171.         cascade = {CascadeType.ALL}
  172.     )
  173.     @JoinColumn(
  174.         name = "NOTE_ITEMS_CLAUSE_TYPE_HJID"
  175.     )
  176.     public List<ClauseTypeNoteItem> getNoteItems() {
  177.         if(this.noteItems == null) {
  178.             this.noteItems = new ArrayList();
  179.         }
  180.  
  181.         if(ItemUtils.shouldBeWrapped(this.note)) {
  182.             this.note = ItemUtils.wrap(this.note, this.noteItems, ClauseTypeNoteItem.class);
  183.         }
  184.  
  185.         return this.noteItems;
  186.     }
  187.  
  188.     public void setNoteItems(List<ClauseTypeNoteItem> value) {
  189.         this.note = null;
  190.         this.noteItems = null;
  191.         this.noteItems = value;
  192.         if(this.noteItems == null) {
  193.             this.noteItems = new ArrayList();
  194.         }
  195.  
  196.         if(ItemUtils.shouldBeWrapped(this.note)) {
  197.             this.note = ItemUtils.wrap(this.note, this.noteItems, ClauseTypeNoteItem.class);
  198.         }
  199.  
  200.     }
  201. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement