// Path: src/main/java/com/github/mmonkey/destinations/persistence/repositories/WorldRepository.java
// public class WorldRepository extends EntityRepository<WorldEntity> {
// 
//     public static final WorldRepository instance = new WorldRepository();
// 
//     /**
//      * Get a PlayerEntity by identifier
//      *
//      * @param identifier String
//      * @return PlayerEntity
//      */
//     public Optional<WorldEntity> get(String identifier) {
//         Preconditions.checkNotNull(identifier);
// 
//         Session session = this.sessionFactory.openSession();
//         session.beginTransaction();
//         Query query = session.createNamedQuery("getWorldByIdentifier", WorldEntity.class);
//         query.setParameter("identifier", identifier);
// 
//         try {
//             WorldEntity result = (WorldEntity) query.getSingleResult();
//             session.close();
//             return Optional.of(result);
//         } catch (Exception e) {
//             session.close();
//             return Optional.empty();
//         }
//     }
// 
// }


import com.flowpowered.math.vector.Vector3d;
import com.github.mmonkey.destinations.persistence.repositories.WorldRepository;
import com.google.common.base.Preconditions;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Optional;
    private Double yaw;

    @Column(name = "pitch")
    private Double pitch;

    @Column(name = "roll")
    private Double roll;

    @ManyToOne(cascade = CascadeType.MERGE, optional = false)
    @JoinColumn(name = "world_id", nullable = false)
    private WorldEntity world;

    /**
     * SpawnEntity default constructor
     */
    public SpawnEntity() {
    }

    /**
     * SpawnEntity Constructor
     *
     * @param entity Entity
     */
    public SpawnEntity(org.spongepowered.api.entity.Entity entity) {
        Preconditions.checkNotNull(entity);

        this.yaw = entity.getRotation().getX();
        this.pitch = entity.getRotation().getY();
        this.roll = entity.getRotation().getZ();

// Path: src/main/java/com/github/mmonkey/destinations/persistence/repositories/WorldRepository.java
// public class WorldRepository extends EntityRepository<WorldEntity> {
// 
//     public static final WorldRepository instance = new WorldRepository();
// 
//     /**
//      * Get a PlayerEntity by identifier
//      *
//      * @param identifier String
//      * @return PlayerEntity
//      */
//     public Optional<WorldEntity> get(String identifier) {
//         Preconditions.checkNotNull(identifier);
// 
//         Session session = this.sessionFactory.openSession();
//         session.beginTransaction();
//         Query query = session.createNamedQuery("getWorldByIdentifier", WorldEntity.class);
//         query.setParameter("identifier", identifier);
// 
//         try {
//             WorldEntity result = (WorldEntity) query.getSingleResult();
//             session.close();
//             return Optional.of(result);
//         } catch (Exception e) {
//             session.close();
//             return Optional.empty();
//         }
//     }
// 
// }


// Path: src/main/java/com/github/mmonkey/destinations/entities/SpawnEntity.java
import com.flowpowered.math.vector.Vector3d;
import com.github.mmonkey.destinations.persistence.repositories.WorldRepository;
import com.google.common.base.Preconditions;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Optional;

    private Double yaw;

    @Column(name = "pitch")
    private Double pitch;

    @Column(name = "roll")
    private Double roll;

    @ManyToOne(cascade = CascadeType.MERGE, optional = false)
    @JoinColumn(name = "world_id", nullable = false)
    private WorldEntity world;

    /**
     * SpawnEntity default constructor
     */
    public SpawnEntity() {
    }

    /**
     * SpawnEntity Constructor
     *
     * @param entity Entity
     */
    public SpawnEntity(org.spongepowered.api.entity.Entity entity) {
        Preconditions.checkNotNull(entity);

        this.yaw = entity.getRotation().getX();
        this.pitch = entity.getRotation().getY();
        this.roll = entity.getRotation().getZ();

        Optional<WorldEntity> optional = WorldRepository.instance.get(entity.getWorld().getUniqueId().toString());