forked from Archives/Athou_commafeed
added maven embedded deployment with mvn tomee:run
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
#log files
|
#log files
|
||||||
commafeed.log
|
commafeed.log
|
||||||
derby.log
|
derby.log
|
||||||
|
data
|
||||||
|
|
||||||
# Maven build directory
|
# Maven build directory
|
||||||
target
|
target
|
||||||
|
|||||||
70
pom.xml
70
pom.xml
@@ -10,10 +10,56 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<jpa.datasource.name>jdbc/commafeedDS</jpa.datasource.name>
|
<jpa.datasource.name>java:openejb/Resource/My DataSource</jpa.datasource.name>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>apache.releases</id>
|
||||||
|
<url>http://repository.apache.org/content/groups/public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>apache.snapshots</id>
|
||||||
|
<url>http://repository.apache.org/content/groups/snapshots/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>apache.releases</id>
|
||||||
|
<url>http://repository.apache.org/content/groups/public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>apache.snapshots</id>
|
||||||
|
<url>http://repository.apache.org/content/groups/snapshots/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>commafeed</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
@@ -47,6 +93,28 @@
|
|||||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.openejb.maven</groupId>
|
||||||
|
<artifactId>tomee-maven-plugin</artifactId>
|
||||||
|
<version>1.6.0-SNAPSHOT</version>
|
||||||
|
<configuration>
|
||||||
|
<tomeeVersion>1.6.0-SNAPSHOT</tomeeVersion>
|
||||||
|
<tomeeClassifier>plus</tomeeClassifier>
|
||||||
|
<tomeeHttpPort>8082</tomeeHttpPort>
|
||||||
|
<reloadOnUpdate>true</reloadOnUpdate>
|
||||||
|
<synchronization>
|
||||||
|
<updateInterval>1</updateInterval>
|
||||||
|
<extensions>
|
||||||
|
<extension>.class</extension>
|
||||||
|
</extensions>
|
||||||
|
<updateOnlyExtensions>
|
||||||
|
<updateOnlyExtension>.html</updateOnlyExtension>
|
||||||
|
<updateOnlyExtension>.js</updateOnlyExtension>
|
||||||
|
<updateOnlyExtension>.css</updateOnlyExtension>
|
||||||
|
</updateOnlyExtensions>
|
||||||
|
</synchronization>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.zeroturnaround</groupId>
|
<groupId>org.zeroturnaround</groupId>
|
||||||
<artifactId>jrebel-maven-plugin</artifactId>
|
<artifactId>jrebel-maven-plugin</artifactId>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.commafeed.backend.dao;
|
package com.commafeed.backend.dao;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
@@ -13,9 +14,8 @@ import com.google.common.reflect.TypeToken;
|
|||||||
import com.uaihebert.factory.EasyCriteriaFactory;
|
import com.uaihebert.factory.EasyCriteriaFactory;
|
||||||
import com.uaihebert.model.EasyCriteria;
|
import com.uaihebert.model.EasyCriteria;
|
||||||
|
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public abstract class GenericDAO<T, K> {
|
public abstract class GenericDAO<T, K> implements Serializable {
|
||||||
|
|
||||||
private TypeToken<T> type = new TypeToken<T>(getClass()) {
|
private TypeToken<T> type = new TypeToken<T>(getClass()) {
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.commafeed.backend.dao;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.ejb.Stateless;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import com.commafeed.backend.security.PasswordEncryptionService;
|
import com.commafeed.backend.security.PasswordEncryptionService;
|
||||||
@@ -9,6 +10,7 @@ import com.commafeed.frontend.utils.ModelFactory.MF;
|
|||||||
import com.commafeed.model.User;
|
import com.commafeed.model.User;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
|
|
||||||
|
@Stateless
|
||||||
public class UserService extends GenericDAO<User, Long> {
|
public class UserService extends GenericDAO<User, Long> {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
<persistence-unit name="primary">
|
<persistence-unit name="primary">
|
||||||
<jta-data-source>${jpa.datasource.name}</jta-data-source>
|
<jta-data-source>${jpa.datasource.name}</jta-data-source>
|
||||||
<properties>
|
<properties>
|
||||||
|
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
|
||||||
<property name="hibernate.hbm2ddl.auto" value="update" />
|
<property name="hibernate.hbm2ddl.auto" value="update" />
|
||||||
<property name="hibernate.show_sql" value="false" />
|
<property name="hibernate.show_sql" value="false" />
|
||||||
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>
|
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user