Created
March 18, 2013 10:05
-
-
Save martypitt/5186137 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
import javax.persistence.Entity; | |
import javax.persistence.MappedSuperclass; | |
import javax.persistence.OneToOne; | |
@Entity | |
public abstract class AbstractTradingMarket<T extends Tradable> implements Market<T>{ | |
@OneToOne | |
private TradingMarketLedger<AbstractTradingMarket<T>> ledger; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
import javax.persistence.Entity; | |
@Entity | |
public class CommonFuturesMarket extends FuturesMarket { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
import javax.persistence.Entity; | |
@Entity | |
public class FuturesMarket extends AbstractTradingMarket<FutureTrade> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
import javax.persistence.Entity; | |
@Entity | |
public class FutureTrade implements Tradable { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
public interface Market<T extends Tradable> { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mangofactory</groupId> | |
<artifactId>queryDSL-test</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<properties> | |
<query.dsl.version>2.9.0</query.dsl.version> | |
</properties> | |
<dependencies> | |
<dependency> | |
<groupId>com.mysema.querydsl</groupId> | |
<artifactId>querydsl-jpa</artifactId> | |
<version>${query.dsl.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.mysema.querydsl</groupId> | |
<artifactId>querydsl-apt</artifactId> | |
<version>${query.dsl.version}</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.projectlombok</groupId> | |
<artifactId>lombok</artifactId> | |
<version>0.11.4</version> | |
<scope>provided</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.hibernate.javax.persistence</groupId> | |
<artifactId>hibernate-jpa-2.0-api</artifactId> | |
<version>1.0.1.Final</version> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>com.mysema.maven</groupId> | |
<artifactId>apt-maven-plugin</artifactId> | |
<version>1.0.8</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>process</goal> | |
</goals> | |
<configuration> | |
<outputDirectory>target/generated-sources/java</outputDirectory> | |
<processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor> | |
</configuration> | |
</execution> | |
</executions> | |
<dependencies> | |
<dependency> | |
<groupId>com.mysema.querydsl</groupId> | |
<artifactId>querydsl-apt</artifactId> | |
<version>${query.dsl.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>com.mysema.querydsl</groupId> | |
<artifactId>querydsl-jpa</artifactId> | |
<classifier>apt</classifier> | |
<version>${query.dsl.version}</version> | |
</dependency> | |
</dependencies> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
public interface Tradable { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mangofactory; | |
import javax.persistence.Entity; | |
@Entity | |
public class TradingMarketLedger<M extends Market<? extends Tradable>> {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment