forked from Archives/Athou_commafeed
use mysql instead of postgresql
This commit is contained in:
@@ -89,6 +89,17 @@
|
|||||||
<subsystem xmlns="urn:jboss:domain:configadmin:1.0" />
|
<subsystem xmlns="urn:jboss:domain:configadmin:1.0" />
|
||||||
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
|
<subsystem xmlns="urn:jboss:domain:datasources:1.1">
|
||||||
<datasources>
|
<datasources>
|
||||||
|
<datasource jndi-name="java:jboss/datasources/MysqlDS" enabled="${mysql.enabled}" use-java-context="true" pool-name="MysqlDS">
|
||||||
|
<connection-url>jdbc:mysql://${env.OPENSHIFT_DB_HOST}:${env.OPENSHIFT_DB_PORT}/${env.OPENSHIFT_APP_NAME}</connection-url>
|
||||||
|
<driver>mysql</driver>
|
||||||
|
<security>
|
||||||
|
<user-name>${env.OPENSHIFT_DB_USERNAME}</user-name>
|
||||||
|
<password>${env.OPENSHIFT_DB_PASSWORD}</password>
|
||||||
|
</security>
|
||||||
|
<validation>
|
||||||
|
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
|
||||||
|
</validation>
|
||||||
|
</datasource>
|
||||||
<datasource jndi-name="java:/jdbc/commafeedDS"
|
<datasource jndi-name="java:/jdbc/commafeedDS"
|
||||||
enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS"
|
enabled="${postgresql.enabled}" use-java-context="true" pool-name="PostgreSQLDS"
|
||||||
use-ccm="true">
|
use-ccm="true">
|
||||||
@@ -109,6 +120,9 @@
|
|||||||
</pool>
|
</pool>
|
||||||
</datasource>
|
</datasource>
|
||||||
<drivers>
|
<drivers>
|
||||||
|
<driver name="mysql" module="com.mysql.jdbc">
|
||||||
|
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
|
||||||
|
</driver>
|
||||||
<driver name="postgresql" module="org.postgresql.jdbc">
|
<driver name="postgresql" module="org.postgresql.jdbc">
|
||||||
<xa-datasource-class>org.postgresql.xa.PGXADataSource
|
<xa-datasource-class>org.postgresql.xa.PGXADataSource
|
||||||
</xa-datasource-class>
|
</xa-datasource-class>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -236,7 +236,7 @@
|
|||||||
<profile>
|
<profile>
|
||||||
<id>openshift</id>
|
<id>openshift</id>
|
||||||
<properties>
|
<properties>
|
||||||
<jpa.datasource.name>java:/jdbc/commafeedDS</jpa.datasource.name>
|
<jpa.datasource.name>java:jboss/datasources/MysqlDS</jpa.datasource.name>
|
||||||
</properties>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<finalName>commafeed</finalName>
|
<finalName>commafeed</finalName>
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ import javax.persistence.Table;
|
|||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.Base64;
|
|
||||||
import org.apache.commons.codec.binary.StringUtils;
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "FEEDENTRIES")
|
@Table(name = "FEEDENTRIES")
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
@@ -39,15 +36,6 @@ public class FeedEntry implements Serializable {
|
|||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
private Date updated;
|
private Date updated;
|
||||||
|
|
||||||
public String getContent() {
|
|
||||||
return StringUtils.newStringUtf8(Base64.decodeBase64(content));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setContent(String content) {
|
|
||||||
this.content = Base64.encodeBase64String(StringUtils
|
|
||||||
.getBytesUtf8(content));
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getGuid() {
|
public String getGuid() {
|
||||||
return guid;
|
return guid;
|
||||||
}
|
}
|
||||||
@@ -64,6 +52,14 @@ public class FeedEntry implements Serializable {
|
|||||||
this.title = title;
|
this.title = title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user