package org.thinkinghub.gateway.oauth.entity;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Entity
@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
public class AuthenticationHistory extends GatewayPersistable {

    private static final long serialVersionUID = 6893602210224518770L;

    @ManyToOne
    private User user;

    @Enumerated(EnumType.STRING)
    private ServiceType serviceType;

    @Enumerated(EnumType.STRING)
    private ErrorType errorType;

    private String callback;
    
    private String state;
    
    @Enumerated(EnumType.STRING)
    private ServiceStatus serviceStatus;

    private String errorCode;

    private String errorDesc;

    private String rawResponse;


    public AuthenticationHistory(Long id) {
        super(id);
    }
}

@@ -40,16 +40,49 @@
 ntity;%0A%0A
+import javax.persistence.Column;%0A
 import j
@@ -178,16 +178,46 @@
 erated;%0A
+import javax.persistence.Lob;%0A
 import j
@@ -971,16 +971,61 @@
 orDesc;%0A
+    %0A    @Column(name=%22rawResponse%22)%0A    @Lob
 %0A    pri

fix the SQL error for Value too long for column RAW_RESPONSE