From 026b1afdce47370ff9d37d34538d29301f349d88 Mon Sep 17 00:00:00 2001 From: Sebastien Date: Sun, 5 Aug 2018 15:27:20 +0200 Subject: [PATCH] Add missing relation type --- .../java/net/Broken/DB/Entity/PendingPwdResetEntity.java | 6 ++---- src/main/java/net/Broken/MainBot.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/net/Broken/DB/Entity/PendingPwdResetEntity.java b/src/main/java/net/Broken/DB/Entity/PendingPwdResetEntity.java index 6bd2cfa..0e648b8 100644 --- a/src/main/java/net/Broken/DB/Entity/PendingPwdResetEntity.java +++ b/src/main/java/net/Broken/DB/Entity/PendingPwdResetEntity.java @@ -1,9 +1,6 @@ package net.Broken.DB.Entity; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; +import javax.persistence.*; import java.util.Calendar; import java.util.Date; @@ -14,6 +11,7 @@ public class PendingPwdResetEntity { @GeneratedValue(strategy= GenerationType.AUTO) private Integer id; + @OneToOne private UserEntity userEntity; private String securityToken; private Date expirationDate; diff --git a/src/main/java/net/Broken/MainBot.java b/src/main/java/net/Broken/MainBot.java index 9f195b2..8b6fe25 100644 --- a/src/main/java/net/Broken/MainBot.java +++ b/src/main/java/net/Broken/MainBot.java @@ -63,15 +63,13 @@ public class MainBot { logger.debug(aArg); if(aArg.startsWith("--") || aArg.startsWith("-")){ aArg = aArg.replaceAll("-",""); - if(aArg.equals("token") || aArg.equals("t")){ - token = args[i+1]; - } - else if(aArg.equals("dev") || aArg.equals("d")){ + if(aArg.equals("dev") || aArg.equals("d")){ dev = true; } } i++; } + token = System.getenv("TOKEN"); jda = Init.initJda(token, dev); ConfigurableApplicationContext ctx = SpringApplication.run(MainBot.class, args);