Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spring.datasource.url=jdbc:mysql://localhost:3306/db_example?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC&autoReconnect=true&useSSL=false
- spring.datasource.username=user
- spring.datasource.password=1234
- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
- #spring.jpa.show-sql=true
- spring.jpa.hibernate.ddl-auto=update
- @Repository
- public interface TreeMapWrapperForSafeBoxRepo extends CrudRepository<TreeMapWrapperForSafeBox, Long> {
- TreeMapWrapperForSafeBox findTreeMapWrapperForSafeBoxByCurrencyAndType(String currency, String type);
- @Entity
- public class TreeMapWrapperForSafeBox {
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- Long multiHashMapWrapper_id;
- private String partName;
- private String type;
- @OneToMany(mappedBy = "treeMapWrapperForSafeBox", cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true)
- private Map<Long, SafeBoxForLongString> longSafeTimeAndReponseMap = new TreeMap<>();
- public TreeMapWrapperForSafeBox(String partName, String type) {
- this.partName = partName;
- this.type = type;
- }
- public TreeMapWrapperForSafeBox() {
- }
- public String getPartName() {
- return partName;
- }
- public void setPartName(String partName) {
- this.partName = partName;
- }
- public Map<Long, SafeBoxForLongString> getLongSafeTimeAndReponseMap() {
- return longSafeTimeAndReponseMap;
- }
- public void setLongSafeTimeAndReponseMap(Map<Long, SafeBoxForLongString> longSafeTimeAndReponseMap) {
- this.longSafeTimeAndReponseMap = longSafeTimeAndReponseMap;
- }
- public String getType() {
- return type;
- }
- public void setType(String type) {
- this.type = type;
- }
- public Long getMultiHashMapWrapper_id() {
- return multiHashMapWrapper_id;
- }
- public void setMultiHashMapWrapper_id(Long multiHashMapWrapper_id) {
- this.multiHashMapWrapper_id = multiHashMapWrapper_id;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- TreeMapWrapperForSafeBox that = (TreeMapWrapperForSafeBox) o;
- if (multiHashMapWrapper_id != null ? !multiHashMapWrapper_id.equals(that.multiHashMapWrapper_id) : that.multiHashMapWrapper_id != null)
- return false;
- if (partName != null ? !partName.equals(that.partName) : that.partName != null) return false;
- return type != null ? type.equals(that.type) : that.type == null;
- }
- @Override
- public int hashCode() {
- int result = multiHashMapWrapper_id != null ? multiHashMapWrapper_id.hashCode() : 0;
- result = 31 * result + (partName != null ? partName.hashCode() : 0);
- result = 31 * result + (type != null ? type.hashCode() : 0);
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement