explicitly mapped missing JPA columns in common-oauth2.model #317

pull/357/merge
William Kim 2013-06-11 14:42:35 -04:00 committed by Justin Richer
parent c577b691c7
commit 46641a2fa1
5 changed files with 15 additions and 6 deletions

View File

@ -31,7 +31,7 @@ import javax.persistence.Table;
import org.springframework.security.oauth2.provider.OAuth2Authentication; import org.springframework.security.oauth2.provider.OAuth2Authentication;
@Entity @Entity
@Table(name="authentication_holder") @Table(name = "authentication_holder")
@NamedQueries ({ @NamedQueries ({
@NamedQuery(name = "AuthenticationHolderEntity.getByAuthentication", query = "select a from AuthenticationHolderEntity a where a.authentication = :authentication") @NamedQuery(name = "AuthenticationHolderEntity.getByAuthentication", query = "select a from AuthenticationHolderEntity a where a.authentication = :authentication")
}) })
@ -49,6 +49,7 @@ public class AuthenticationHolderEntity {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Long getId() { public Long getId() {
return id; return id;
} }
@ -58,7 +59,7 @@ public class AuthenticationHolderEntity {
} }
@Basic @Basic
@Column(name="owner_id") @Column(name = "owner_id")
public Long getOwnerId() { public Long getOwnerId() {
return ownerId; return ownerId;
} }
@ -69,6 +70,7 @@ public class AuthenticationHolderEntity {
@Lob @Lob
@Basic(fetch=FetchType.LAZY) @Basic(fetch=FetchType.LAZY)
@Column(name = "authentication")
public OAuth2Authentication getAuthentication() { public OAuth2Authentication getAuthentication() {
return authentication; return authentication;
} }

View File

@ -37,7 +37,7 @@ import org.springframework.security.oauth2.provider.code.AuthorizationRequestHol
* *
*/ */
@Entity @Entity
@Table(name="authorization_code") @Table(name = "authorization_code")
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "AuthorizationCodeEntity.getByValue", query = "select a from AuthorizationCodeEntity a where a.code = :code") @NamedQuery(name = "AuthorizationCodeEntity.getByValue", query = "select a from AuthorizationCodeEntity a where a.code = :code")
}) })
@ -72,6 +72,7 @@ public class AuthorizationCodeEntity {
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Long getId() { public Long getId() {
return id; return id;
} }
@ -87,6 +88,7 @@ public class AuthorizationCodeEntity {
* @return the code * @return the code
*/ */
@Basic @Basic
@Column(name = "code")
public String getCode() { public String getCode() {
return code; return code;
} }

View File

@ -58,7 +58,7 @@ import org.springframework.security.oauth2.provider.ClientDetails;
* *
*/ */
@Entity @Entity
@Table(name="client_details") @Table(name = "client_details")
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "ClientDetailsEntity.findAll", query = "SELECT c FROM ClientDetailsEntity c"), @NamedQuery(name = "ClientDetailsEntity.findAll", query = "SELECT c FROM ClientDetailsEntity c"),
@NamedQuery(name = "ClientDetailsEntity.getByClientId", query = "select c from ClientDetailsEntity c where c.clientId = :clientId") @NamedQuery(name = "ClientDetailsEntity.getByClientId", query = "select c from ClientDetailsEntity c where c.clientId = :clientId")
@ -218,6 +218,7 @@ public class ClientDetailsEntity implements ClientDetails {
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Long getId() { public Long getId() {
return id; return id;
} }

View File

@ -55,7 +55,7 @@ import com.nimbusds.jwt.JWTParser;
* *
*/ */
@Entity @Entity
@Table(name="access_token") @Table(name = "access_token")
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "OAuth2AccessTokenEntity.getByRefreshToken", query = "select a from OAuth2AccessTokenEntity a where a.refreshToken = :refreshToken"), @NamedQuery(name = "OAuth2AccessTokenEntity.getByRefreshToken", query = "select a from OAuth2AccessTokenEntity a where a.refreshToken = :refreshToken"),
@NamedQuery(name = "OAuth2AccessTokenEntity.getByClient", query = "select a from OAuth2AccessTokenEntity a where a.client = :client"), @NamedQuery(name = "OAuth2AccessTokenEntity.getByClient", query = "select a from OAuth2AccessTokenEntity a where a.client = :client"),
@ -103,6 +103,7 @@ public class OAuth2AccessTokenEntity implements OAuth2AccessToken {
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Long getId() { public Long getId() {
return id; return id;
} }
@ -183,6 +184,7 @@ public class OAuth2AccessTokenEntity implements OAuth2AccessToken {
@Override @Override
@Basic @Basic
@Temporal(javax.persistence.TemporalType.TIMESTAMP) @Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Column(name = "expiration")
public Date getExpiration() { public Date getExpiration() {
return expiration; return expiration;
} }

View File

@ -47,7 +47,7 @@ import com.nimbusds.jwt.JWTParser;
* *
*/ */
@Entity @Entity
@Table(name="refresh_token") @Table(name = "refresh_token")
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "OAuth2RefreshTokenEntity.getByClient", query = "select r from OAuth2RefreshTokenEntity r where r.client = :client"), @NamedQuery(name = "OAuth2RefreshTokenEntity.getByClient", query = "select r from OAuth2RefreshTokenEntity r where r.client = :client"),
@NamedQuery(name = "OAuth2RefreshTokenEntity.getExpired", query = "select r from OAuth2RefreshTokenEntity r where r.expiration is not null and r.expiration < current_timestamp"), @NamedQuery(name = "OAuth2RefreshTokenEntity.getExpired", query = "select r from OAuth2RefreshTokenEntity r where r.expiration is not null and r.expiration < current_timestamp"),
@ -80,6 +80,7 @@ public class OAuth2RefreshTokenEntity implements OAuth2RefreshToken {
*/ */
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
public Long getId() { public Long getId() {
return id; return id;
} }
@ -131,6 +132,7 @@ public class OAuth2RefreshTokenEntity implements OAuth2RefreshToken {
@Basic @Basic
@Temporal(javax.persistence.TemporalType.TIMESTAMP) @Temporal(javax.persistence.TemporalType.TIMESTAMP)
@Column(name = "expiration")
public Date getExpiration() { public Date getExpiration() {
return expiration; return expiration;
} }