Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.08 KB | None | 0 0
  1. <?xml version='1.0' encoding='utf-8'?>
  2. <!DOCTYPE hibernate-configuration PUBLIC
  3. "-//Hibernate/Hibernate Configuration DTD//EN"
  4. "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  5. <hibernate-configuration>
  6. <session-factory>
  7.  
  8. <!-- Database connection settings -->
  9. <property name="connection.driver_class">org.postgresql.Driver</property>
  10. <property name="connection.url">jdbc:postgresql://url/subfolder</property>
  11. <property name="connection.username">user</property>
  12. <property name="connection.password">pass</property>
  13.  
  14. <!-- JDBC connection pool (use the built-in) -->
  15. <property name="connection.pool_size">1</property>
  16.  
  17. <!-- SQL dialect -->
  18. <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</property>
  19.  
  20. <!-- Enable Hibernate's automatic session context management -->
  21. <property name="current_session_context_class">thread</property>
  22.  
  23. <!-- Echo all executed SQL to stdout -->
  24. <property name="show_sql">true</property>
  25.  
  26. <!-- Drop and re-create the database schema on startup -->
  27. <property name="hbm2ddl.auto">create</property>
  28. <mapping class="no.hib.dat100.GameLog"/>
  29. <mapping class="no.hib.dat100.GamelogJPA"/>
  30.  
  31. <!-- DB schema will be updated if needed -->
  32. <!-- <property name="hbm2ddl.auto">update</property> -->
  33. </session-factory>
  34. </hibernate-configuration>
  35.  
  36. package no.hib.dat100;
  37.  
  38. import javax.persistence.*;
  39.  
  40. /**
  41. * Created by VJG on 29.03.2017.
  42. */
  43. @Entity
  44. @Table(name = "gamelog", schema = "public", catalog = "v17_dat101_g15")
  45. public class GamelogJPA {
  46. private Integer round;
  47. private Integer player;
  48. private Integer roll;
  49. private Integer newPlacement;
  50. private Integer eventId;
  51. private Integer rollValue;
  52.  
  53. @Basic
  54. @Column(name = "round", nullable = true)
  55. public Integer getRound() {
  56. return round;
  57. }
  58.  
  59. public void setRound(Integer round) {
  60. this.round = round;
  61. }
  62.  
  63. @Basic
  64. @Column(name = "player", nullable = true)
  65. public Integer getPlayer() {
  66. return player;
  67. }
  68.  
  69. public void setPlayer(Integer player) {
  70. this.player = player;
  71. }
  72.  
  73. @Basic
  74. @Column(name = "roll_value", nullable = true)
  75. public Integer getRoll() {
  76. return roll;
  77. }
  78.  
  79. public void setRoll(Integer roll) {
  80. this.roll = roll;
  81. }
  82.  
  83. @Basic
  84. @Column(name = "new_placement", nullable = true)
  85. public Integer getNewPlacement() {
  86. return newPlacement;
  87. }
  88.  
  89. public void setNewPlacement(Integer newPlacement) {
  90. this.newPlacement = newPlacement;
  91. }
  92.  
  93. @Id
  94. @Column(name = "event_id", nullable = false)
  95. public Integer getEventId() {
  96. return eventId;
  97. }
  98.  
  99. public void setEventId(Integer eventId) {
  100. this.eventId = eventId;
  101. }
  102.  
  103. @Override
  104. public boolean equals(Object o) {
  105. if (this == o) return true;
  106. if (o == null || getClass() != o.getClass()) return false;
  107.  
  108. GamelogJPA that = (GamelogJPA) o;
  109.  
  110. if (round != null ? !round.equals(that.round) : that.round != null) return false;
  111. if (player != null ? !player.equals(that.player) : that.player != null) return false;
  112. if (roll != null ? !roll.equals(that.roll) : that.roll != null) return false;
  113. if (newPlacement != null ? !newPlacement.equals(that.newPlacement) : that.newPlacement != null) return false;
  114. if (eventId != null ? !eventId.equals(that.eventId) : that.eventId != null) return false;
  115.  
  116. return true;
  117. }
  118.  
  119. @Override
  120. public int hashCode() {
  121. int result = round != null ? round.hashCode() : 0;
  122. result = 31 * result + (player != null ? player.hashCode() : 0);
  123. result = 31 * result + (roll != null ? roll.hashCode() : 0);
  124. result = 31 * result + (newPlacement != null ? newPlacement.hashCode() : 0);
  125. result = 31 * result + (eventId != null ? eventId.hashCode() : 0);
  126. return result;
  127. }
  128.  
  129. @Basic
  130. @Column(name = "roll_value", nullable = true)
  131. public Integer getRollValue() {
  132. return rollValue;
  133. }
  134.  
  135. public void setRollValue(Integer rollValue) {
  136. this.rollValue = rollValue;
  137. }
  138. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement