return maker.makeAndPersist(entityManager, HAccount.class,
new FixIdCallback(HAccount.class, accountId));
}
public void makeSampleProject() {
EntityMaker maker =
EntityMakerBuilder
.builder()
// project
.addFieldOrPropertyMaker(HProject.class, "slug",
FixedValueMaker.fix("about-fedora"))
.addFieldOrPropertyMaker(HProject.class, "name",
FixedValueMaker.fix("about fedora"))
// iteration
.addFieldOrPropertyMaker(HProjectIteration.class,
"slug", FixedValueMaker.fix("master"))
.addFieldOrPropertyMaker(HProject.class,
"sourceViewURL",
FixedValueMaker.EMPTY_STRING_MAKER)
// document
// public HDocument(String docId, String name, String
// path,
// ContentType contentType, HLocale locale)
.addConstructorParameterMaker(HDocument.class, 0,
FixedValueMaker.fix("About_Fedora"))
.addConstructorParameterMaker(HDocument.class, 1,
FixedValueMaker.fix("About_Fedora"))
.addConstructorParameterMaker(HDocument.class, 2,
FixedValueMaker.EMPTY_STRING_MAKER)
.addConstructorParameterMaker(HDocument.class, 3,
FixedValueMaker.fix(ContentType.PO))
.reuseEntity(enUSLocale).build();
maker.makeAndPersist(entityManager, HTextFlowTarget.class,
Callbacks.wireManyToMany(HProject.class, admin));
}