1. 在JPA项目中配置添加elide-spring-boot-starter依赖, 并在application.yml添加配置,在domain中加上@include即可。 具体如下:
application.yml
elide:
modelPackage: 'com.ygf.elide.graphql.domain'
json-api:
path: /api/v1
enabled: true
graphql:
path: /graphql/api/v1
enabled: true
async:
enabled: false
threadPoolSize: 2
maxRunTime: 65
cleanupEnabled: true
queryCleanupDays: 7
defaultAsyncQueryDAO: true
export:
enabled: false
pom.xml
<dependency> <groupId>com.yahoo.elide</groupId> <artifactId>elide-spring-boot-starter</artifactId> <version>${elide.version}</version> </dependency>
Domain定义
@Include(name = "parent")
@Entity
@Table(name = "parent")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Parent implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequenceGenerator")
@SequenceGenerator(name = "sequenceGenerator")
@Column(name = "id")
private Long id;
}
2. 问题:
a> domain中存在blob字段时不成功。原因未明。。。。