Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. private String codeTax;
  2. private Compte compte;
  3. private String libTax;
  4. private double valeurTax;
  5. private String natureTax;
  6. private String typeTax;
  7. private String sensTax;
  8.  
  9. public Taxe() {
  10. }
  11.  
  12. public Taxe(Compte compte, String libTax, double valeurTax,
  13. String natureTax, String typeTax, String sensTax) {
  14. this.compte = compte;
  15. this.libTax = libTax;
  16. this.valeurTax = valeurTax;
  17. this.natureTax = natureTax;
  18. this.typeTax = typeTax;
  19. this.sensTax = sensTax;
  20. }
  21.  
  22. public Taxe(String libTax, double valeurTax,
  23. String natureTax, String typeTax, String sensTax) {
  24. this.libTax = libTax;
  25. this.valeurTax = valeurTax;
  26. this.natureTax = natureTax;
  27. this.typeTax = typeTax;
  28. this.sensTax = sensTax;
  29. }
  30.  
  31. @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "compte"))
  32. @Id
  33. @GeneratedValue(generator = "generator")
  34. @Column(name = "CODE_TAX", unique = true, nullable = false, length = 50)
  35. public String getCodeTax() {
  36. return this.codeTax;
  37. }
  38.  
  39. public void setCodeTax(String codeTax) {
  40. this.codeTax = codeTax;
  41. }
  42.  
  43. @OneToOne(fetch = FetchType.LAZY)
  44. @PrimaryKeyJoinColumn
  45. public Compte getCompte() {
  46. return this.compte;
  47. }
  48.  
  49. public void setCompte(Compte compte) {
  50. this.compte = compte;
  51. }
  52.  
  53. @Column(name = "LIB_TAX", nullable = false, length = 50)
  54. public String getLibTax() {
  55. return this.libTax;
  56. }
  57.  
  58. public void setLibTax(String libTax) {
  59. this.libTax = libTax;
  60. }
  61.  
  62. @Column(name = "VALEUR_TAX", nullable = false, precision = 53, scale = 0)
  63. public double getValeurTax() {
  64. return this.valeurTax;
  65. }
  66.  
  67. public void setValeurTax(double valeurTax) {
  68. this.valeurTax = valeurTax;
  69. }
  70.  
  71. @Column(name = "NATURE_TAX", nullable = false, length = 50)
  72. public String getNatureTax() {
  73. return this.natureTax;
  74. }
  75.  
  76. public void setNatureTax(String natureTax) {
  77. this.natureTax = natureTax;
  78. }
  79.  
  80. @Column(name = "TYPE_TAX", nullable = false, length = 50)
  81. public String getTypeTax() {
  82. return this.typeTax;
  83. }
  84.  
  85. public void setTypeTax(String typeTax) {
  86. this.typeTax = typeTax;
  87. }
  88.  
  89. @Column(name = "SENS_TAX", nullable = false, length = 50)
  90. public String getSensTax() {
  91. return this.sensTax;
  92. }
  93.  
  94. public void setSensTax(String sensTax) {
  95. this.sensTax = sensTax;
  96. }
  97.  
  98. Compte cpt = cptManager.getCompteById(numCpt);
  99. Taxe tax = new Taxe(cpt,libTax, Double.parseDouble(valeurTax), natureTax, typeTax, sensTax);
  100. tax.setCodeTax(codeTax);
  101. cpt.setTaxe(tax);
  102.  
  103. taxManager.addTaxe(tax);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement