Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. spring.datasource.url=jdbc:mysql://localhost:3306/db_example?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&autoReconnect=true&useSSL=false
  2. spring.datasource.username=user
  3. spring.datasource.password=1234
  4. spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  5. #spring.jpa.show-sql=true
  6. spring.jpa.hibernate.ddl-auto=update
  7.  
  8. @Repository
  9. public interface TreeMapWrapperForSafeBoxRepo extends CrudRepository<TreeMapWrapperForSafeBox, Long> {
  10.  
  11.  
  12. TreeMapWrapperForSafeBox findTreeMapWrapperForSafeBoxByCurrencyAndType(String currency, String type);
  13.  
  14. @Entity
  15. public class TreeMapWrapperForSafeBox {
  16.  
  17. @Id
  18. @GeneratedValue(strategy = GenerationType.AUTO)
  19. Long multiHashMapWrapper_id;
  20.  
  21. private String partName;
  22.  
  23. private String type;
  24. @OneToMany(mappedBy = "treeMapWrapperForSafeBox", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
  25. private Map<Long, SafeBoxForLongString> longSafeTimeAndReponseMap = new TreeMap<>();
  26.  
  27. public TreeMapWrapperForSafeBox(String partName, String type) {
  28. this.partName = partName;
  29. this.type = type;
  30. }
  31.  
  32. public TreeMapWrapperForSafeBox() {
  33. }
  34.  
  35. public String getPartName() {
  36. return partName;
  37. }
  38.  
  39. public void setPartName(String partName) {
  40. this.partName = partName;
  41. }
  42.  
  43. public Map<Long, SafeBoxForLongString> getLongSafeTimeAndReponseMap() {
  44. return longSafeTimeAndReponseMap;
  45. }
  46.  
  47. public void setLongSafeTimeAndReponseMap(Map<Long, SafeBoxForLongString> longSafeTimeAndReponseMap) {
  48. this.longSafeTimeAndReponseMap = longSafeTimeAndReponseMap;
  49. }
  50.  
  51. public String getType() {
  52. return type;
  53. }
  54.  
  55. public void setType(String type) {
  56. this.type = type;
  57. }
  58.  
  59. public Long getMultiHashMapWrapper_id() {
  60. return multiHashMapWrapper_id;
  61. }
  62.  
  63. public void setMultiHashMapWrapper_id(Long multiHashMapWrapper_id) {
  64. this.multiHashMapWrapper_id = multiHashMapWrapper_id;
  65. }
  66.  
  67. @Override
  68. public boolean equals(Object o) {
  69. if (this == o) return true;
  70. if (o == null || getClass() != o.getClass()) return false;
  71.  
  72. TreeMapWrapperForSafeBox that = (TreeMapWrapperForSafeBox) o;
  73.  
  74. if (multiHashMapWrapper_id != null ? !multiHashMapWrapper_id.equals(that.multiHashMapWrapper_id) : that.multiHashMapWrapper_id != null)
  75. return false;
  76. if (partName != null ? !partName.equals(that.partName) : that.partName != null) return false;
  77. return type != null ? type.equals(that.type) : that.type == null;
  78. }
  79.  
  80. @Override
  81. public int hashCode() {
  82. int result = multiHashMapWrapper_id != null ? multiHashMapWrapper_id.hashCode() : 0;
  83. result = 31 * result + (partName != null ? partName.hashCode() : 0);
  84. result = 31 * result + (type != null ? type.hashCode() : 0);
  85. return result;
  86. }
  87.  
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement