Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version='1.0' encoding='utf-8'?>
- <!DOCTYPE hibernate-configuration PUBLIC
- "-//Hibernate/Hibernate Configuration DTD//EN"
- "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
- <hibernate-configuration>
- <session-factory>
- <!-- Database connection settings -->
- <property name="connection.driver_class">org.postgresql.Driver</property>
- <property name="connection.url">jdbc:postgresql://url/subfolder</property>
- <property name="connection.username">user</property>
- <property name="connection.password">pass</property>
- <!-- JDBC connection pool (use the built-in) -->
- <property name="connection.pool_size">1</property>
- <!-- SQL dialect -->
- <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQL9Dialect</property>
- <!-- Enable Hibernate's automatic session context management -->
- <property name="current_session_context_class">thread</property>
- <!-- Echo all executed SQL to stdout -->
- <property name="show_sql">true</property>
- <!-- Drop and re-create the database schema on startup -->
- <property name="hbm2ddl.auto">create</property>
- <mapping class="no.hib.dat100.GameLog"/>
- <mapping class="no.hib.dat100.GamelogJPA"/>
- <!-- DB schema will be updated if needed -->
- <!-- <property name="hbm2ddl.auto">update</property> -->
- </session-factory>
- </hibernate-configuration>
- package no.hib.dat100;
- import javax.persistence.*;
- /**
- * Created by VJG on 29.03.2017.
- */
- @Entity
- @Table(name = "gamelog", schema = "public", catalog = "v17_dat101_g15")
- public class GamelogJPA {
- private Integer round;
- private Integer player;
- private Integer roll;
- private Integer newPlacement;
- private Integer eventId;
- private Integer rollValue;
- @Basic
- @Column(name = "round", nullable = true)
- public Integer getRound() {
- return round;
- }
- public void setRound(Integer round) {
- this.round = round;
- }
- @Basic
- @Column(name = "player", nullable = true)
- public Integer getPlayer() {
- return player;
- }
- public void setPlayer(Integer player) {
- this.player = player;
- }
- @Basic
- @Column(name = "roll_value", nullable = true)
- public Integer getRoll() {
- return roll;
- }
- public void setRoll(Integer roll) {
- this.roll = roll;
- }
- @Basic
- @Column(name = "new_placement", nullable = true)
- public Integer getNewPlacement() {
- return newPlacement;
- }
- public void setNewPlacement(Integer newPlacement) {
- this.newPlacement = newPlacement;
- }
- @Id
- @Column(name = "event_id", nullable = false)
- public Integer getEventId() {
- return eventId;
- }
- public void setEventId(Integer eventId) {
- this.eventId = eventId;
- }
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- GamelogJPA that = (GamelogJPA) o;
- if (round != null ? !round.equals(that.round) : that.round != null) return false;
- if (player != null ? !player.equals(that.player) : that.player != null) return false;
- if (roll != null ? !roll.equals(that.roll) : that.roll != null) return false;
- if (newPlacement != null ? !newPlacement.equals(that.newPlacement) : that.newPlacement != null) return false;
- if (eventId != null ? !eventId.equals(that.eventId) : that.eventId != null) return false;
- return true;
- }
- @Override
- public int hashCode() {
- int result = round != null ? round.hashCode() : 0;
- result = 31 * result + (player != null ? player.hashCode() : 0);
- result = 31 * result + (roll != null ? roll.hashCode() : 0);
- result = 31 * result + (newPlacement != null ? newPlacement.hashCode() : 0);
- result = 31 * result + (eventId != null ? eventId.hashCode() : 0);
- return result;
- }
- @Basic
- @Column(name = "roll_value", nullable = true)
- public Integer getRollValue() {
- return rollValue;
- }
- public void setRollValue(Integer rollValue) {
- this.rollValue = rollValue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement