removed persistence.xml and moved to pure spring-based config, addresses #194

pull/306/merge
Justin Richer 2013-01-30 17:56:54 -05:00
parent a3619240e6
commit 19e7b62a42
5 changed files with 5 additions and 58 deletions

View File

@ -21,7 +21,7 @@ import javax.persistence.Table;
@Table(name = "system_scope") @Table(name = "system_scope")
@NamedQueries({ @NamedQueries({
@NamedQuery(name = "SystemScope.findAll", query = "select s from SystemScope s"), @NamedQuery(name = "SystemScope.findAll", query = "select s from SystemScope s"),
@NamedQuery(name = "SystemScope.getByValue", query = "select s from SystemScope s WHERE value = :value") @NamedQuery(name = "SystemScope.getByValue", query = "select s from SystemScope s WHERE s.value = :value")
}) })
public class SystemScope { public class SystemScope {

View File

@ -9,16 +9,11 @@ import javax.persistence.InheritanceType;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
@Entity
@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
@Table(name="user_info")
public interface UserInfo { public interface UserInfo {
/** /**
* @return the userId * @return the userId
*/ */
@Id
@Column(name="sub")
public abstract String getSub(); public abstract String getSub();
/** /**
@ -29,8 +24,6 @@ public interface UserInfo {
/** /**
* @return the preferred username * @return the preferred username
*/ */
@Basic
@Column(name="preferred_username")
public abstract String getPreferredUsername(); public abstract String getPreferredUsername();
/** /**
@ -41,7 +34,6 @@ public interface UserInfo {
/** /**
* @return the name * @return the name
*/ */
@Basic
public abstract String getName(); public abstract String getName();
/** /**
@ -52,8 +44,6 @@ public interface UserInfo {
/** /**
* @return the givenName * @return the givenName
*/ */
@Basic
@Column(name="given_name")
public abstract String getGivenName(); public abstract String getGivenName();
/** /**
@ -64,8 +54,6 @@ public interface UserInfo {
/** /**
* @return the familyName * @return the familyName
*/ */
@Basic
@Column(name="family_name")
public abstract String getFamilyName(); public abstract String getFamilyName();
/** /**
@ -76,8 +64,6 @@ public interface UserInfo {
/** /**
* @return the middleName * @return the middleName
*/ */
@Basic
@Column(name="middle_name")
public abstract String getMiddleName(); public abstract String getMiddleName();
/** /**
@ -88,7 +74,6 @@ public interface UserInfo {
/** /**
* @return the nickname * @return the nickname
*/ */
@Basic
public abstract String getNickname(); public abstract String getNickname();
/** /**
@ -99,7 +84,6 @@ public interface UserInfo {
/** /**
* @return the profile * @return the profile
*/ */
@Basic
public abstract String getProfile(); public abstract String getProfile();
/** /**
@ -110,7 +94,6 @@ public interface UserInfo {
/** /**
* @return the picture * @return the picture
*/ */
@Basic
public abstract String getPicture(); public abstract String getPicture();
/** /**
@ -121,7 +104,6 @@ public interface UserInfo {
/** /**
* @return the website * @return the website
*/ */
@Basic
public abstract String getWebsite(); public abstract String getWebsite();
/** /**
@ -132,7 +114,6 @@ public interface UserInfo {
/** /**
* @return the email * @return the email
*/ */
@Basic
public abstract String getEmail(); public abstract String getEmail();
/** /**
@ -143,8 +124,6 @@ public interface UserInfo {
/** /**
* @return the verified * @return the verified
*/ */
@Basic
@Column(name="email_verified")
public abstract Boolean getEmailVerified(); public abstract Boolean getEmailVerified();
/** /**
@ -155,7 +134,6 @@ public interface UserInfo {
/** /**
* @return the gender * @return the gender
*/ */
@Basic
public abstract String getGender(); public abstract String getGender();
/** /**
@ -166,8 +144,6 @@ public interface UserInfo {
/** /**
* @return the zoneinfo * @return the zoneinfo
*/ */
@Basic
@Column(name="zone_info")
public abstract String getZoneinfo(); public abstract String getZoneinfo();
/** /**
@ -178,7 +154,6 @@ public interface UserInfo {
/** /**
* @return the locale * @return the locale
*/ */
@Basic
public abstract String getLocale(); public abstract String getLocale();
/** /**
@ -189,8 +164,6 @@ public interface UserInfo {
/** /**
* @return the phoneNumber * @return the phoneNumber
*/ */
@Basic
@Column(name="phone_number")
public abstract String getPhoneNumber(); public abstract String getPhoneNumber();
/** /**
@ -201,7 +174,6 @@ public interface UserInfo {
/** /**
* @return the address * @return the address
*/ */
@OneToOne
public abstract Address getAddress(); public abstract Address getAddress();
/** /**
@ -212,8 +184,6 @@ public interface UserInfo {
/** /**
* @return the updatedTime * @return the updatedTime
*/ */
@Basic
@Column(name="updated_time")
public abstract String getUpdatedTime(); public abstract String getUpdatedTime();
/** /**
@ -226,8 +196,6 @@ public interface UserInfo {
* *
* @return * @return
*/ */
@Basic
@Column(name="birthdate")
public abstract String getBirthdate(); public abstract String getBirthdate();
/** /**

View File

@ -1,23 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="openidPersistenceUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>org.mitre.oauth2.model.ClientDetailsEntity</class>
<class>org.mitre.oauth2.model.OAuth2AccessTokenEntity</class>
<class>org.mitre.oauth2.model.OAuth2RefreshTokenEntity</class>
<class>org.mitre.oauth2.model.AuthenticationHolderEntity</class>
<class>org.mitre.oauth2.model.AuthorizationCodeEntity</class>
<class>org.mitre.openid.connect.model.Address</class>
<class>org.mitre.openid.connect.model.ApprovedSite</class>
<class>org.mitre.openid.connect.model.Event</class>
<class>org.mitre.openid.connect.model.DefaultUserInfo</class>
<!-- <class>org.mitre.openid.connect.model.UserInfo</class> -->
<class>org.mitre.openid.connect.model.WhitelistedSite</class>
<class>org.mitre.openid.connect.model.BlacklistedSite</class>
<class>org.mitre.openid.connect.model.Nonce</class>
<shared-cache-mode>NONE</shared-cache-mode>
</persistence-unit>
</persistence>

View File

@ -161,7 +161,7 @@ CREATE TABLE IF NOT EXISTS token_scope (
); );
CREATE TABLE IF NOT EXISTS site_scope ( CREATE TABLE IF NOT EXISTS site_scope (
id BIGINT GENERATED BY DFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY,
scope VARCHAR(1024), scope VARCHAR(1024),
description VARCHAR(4096), description VARCHAR(4096),
icon VARCHAR(256), icon VARCHAR(256),

View File

@ -177,7 +177,8 @@
</bean> </bean>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="openidPersistenceUnit" /> <property name="packagesToScan" value="org.mitre" />
<property name="persistenceProviderClass" value="org.eclipse.persistence.jpa.PersistenceProvider" />
<property name="dataSource" ref="dataSource" /> <property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter" ref="jpaAdapter" /> <property name="jpaVendorAdapter" ref="jpaAdapter" />
<property name="jpaPropertyMap"> <property name="jpaPropertyMap">
@ -185,6 +186,7 @@
<entry key="eclipselink.weaving" value="false" /> <entry key="eclipselink.weaving" value="false" />
<entry key="eclipselink.logging.level" value="FINEST" /> <entry key="eclipselink.logging.level" value="FINEST" />
<entry key="eclipselink.logging.level.sql" value="FINEST" /> <entry key="eclipselink.logging.level.sql" value="FINEST" />
<entry key="eclipselink.cache.shared.default" value="false" />
</map> </map>
</property> </property>
</bean> </bean>