本文整理汇总了Java中org.netbeans.jpa.modeler.spec.MappedSuperclass类的典型用法代码示例。如果您正苦于以下问题:Java MappedSuperclass类的具体用法?Java MappedSuperclass怎么用?Java MappedSuperclass使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MappedSuperclass类属于org.netbeans.jpa.modeler.spec包,在下文中一共展示了MappedSuperclass类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generateSuperClasses
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
private void generateSuperClasses()
throws InvalidDataException, IOException {
List<MappedSuperclass> parsedMappedSuperclasses
= parsedEntityMappings.getMappedSuperclass();
for (MappedSuperclass parsedMappedSuperclass : parsedMappedSuperclasses) {
task.log("Generating MappedSuperclass Class : " + parsedMappedSuperclass.getClazz(), true);
ClassDefSnippet classDef = new SuperClassGenerator(
parsedMappedSuperclass, packageName).getClassDef();
classesRepository.addWritableSnippet(
ClassType.SUPER_CLASS, classDef);
writeSnippet(classDef);
}
}
示例2: processSuperClass
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
private static void processSuperClass(WorkSpace workSpace, JavaClass _class, EntityAccessor accessor) {
if (_class.getSuperclass() != null) {
if (_class.getSuperclass() instanceof MappedSuperclass) {
MappedSuperclass superclass = (MappedSuperclass) _class.getSuperclass();
superclass.getAttributes().updateAccessor(workSpace, accessor.getAttributes(), true);
processSuperClass(workSpace, superclass, accessor);
} else {
accessor.setParentClassName(_class.getSuperclass().getClazz());
}
}
}
示例3: getInstance
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
public static MappedSuperclassSpecAccessor getInstance(WorkSpace workSpace, MappedSuperclass mappedSuperclass) {
MappedSuperclassSpecAccessor accessor = new MappedSuperclassSpecAccessor(mappedSuperclass);
accessor.setClassName(mappedSuperclass.getClazz());
accessor.setAccess("VIRTUAL");
accessor.setAttributes(mappedSuperclass.getAttributes().getAccessor(workSpace, true));
if (mappedSuperclass.getSuperclass() != null) {
accessor.setParentClassName(mappedSuperclass.getSuperclass().getClazz());
}
return accessor;
}
示例4: generateMappedSuperClasses
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
private void generateMappedSuperClasses() throws InvalidDataException, IOException {
List<MappedSuperclass> parsedMappedSuperclasses = entityMappings.getMappedSuperclass().stream().filter(e -> e.getGenerateSourceCode()).collect(toList());
if(!parsedMappedSuperclasses.isEmpty()){
task.log(Console.wrap("Generating MappedSuperclass Class : " , FG_RED, BOLD), true);
}
for (MappedSuperclass parsedMappedSuperclass : parsedMappedSuperclasses) {
task.log(parsedMappedSuperclass.getClazz(), true);
ManagedClassDefSnippet classDef = new MappedSuperClassGenerator(parsedMappedSuperclass, packageName).getClassDef();
classDef.setJaxbSupport(entityMappings.getJaxbSupport());
classesRepository.addWritableSnippet(ClassType.SUPER_CLASS, classDef);
parsedMappedSuperclass.setFileObject(ORMConverterUtil.writeSnippet(classDef, destDir));
}
}
示例5: makeSiblingOrphan
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
@Deprecated
private static void makeSiblingOrphan(MappedSuperclass mappedSuperclass) {
IPrimaryKeyAttributes attr = mappedSuperclass.getAttributes();
attr.setManyToMany(null);
attr.setManyToOne(null);
attr.setOneToMany(null);
attr.setOneToOne(null);
attr.setEmbedded(null);
attr.setElementCollection(null);
}
示例6: init
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
@Override
public void init() {
super.init();
MappedSuperclass mappedSuperclass = this.getBaseElementSpec();
if (mappedSuperclass.getAttributes() == null) {
mappedSuperclass.setAttributes(new PrimaryKeyAttributes());
}
if (mappedSuperclass.getClazz() == null || mappedSuperclass.getClazz().isEmpty()) {
mappedSuperclass.setClazz(this.getModelerScene().getNextClassName("MappedSuperclass_"));
}
setName(mappedSuperclass.getClazz());
setLabel(mappedSuperclass.getClazz());
validateName(null, this.getName());
}
示例7: SuperClassGenerator
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
public SuperClassGenerator(
MappedSuperclass parsedMappedSuperclass,
String packageName) {
this.mappedSuperclass = parsedMappedSuperclass;
this.packageName = packageName;
}
示例8: init
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
@Override
public void init() {
MappedSuperclass mappedSuperclass = (MappedSuperclass) this.getBaseElementSpec();
if (mappedSuperclass.getAttributes() == null) {
mappedSuperclass.setAttributes(new Attributes());
// addNewIdAttribute("id");
// sortAttributes();
}
if (mappedSuperclass.getClazz() == null || mappedSuperclass.getClazz().isEmpty()) {
mappedSuperclass.setClazz(((JPAModelerScene) this.getModelerScene()).getNextClassName("MappedSuperclass_"));
}
setName(mappedSuperclass.getClazz());
setLabel(mappedSuperclass.getClazz());
}
示例9: MappedSuperclassSpecAccessor
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
private MappedSuperclassSpecAccessor(MappedSuperclass mappedSuperclass) {
this.mappedSuperclass = mappedSuperclass;
}
示例10: getMappedSuperclass
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
/**
* @return the entity
*/
public MappedSuperclass getMappedSuperclass() {
return mappedSuperclass;
}
示例11: MappedSuperClassGenerator
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
public MappedSuperClassGenerator(MappedSuperclass parsedMappedSuperclass, String packageName) {
super(new ManagedClassDefSnippet(), parsedMappedSuperclass.getRootElement().getJavaEEVersion());
this.mappedSuperclass = parsedMappedSuperclass;
this.rootPackageName = packageName;
this.packageName = mappedSuperclass.getAbsolutePackage(rootPackageName);
}
示例12: createBaseElementSpec
import org.netbeans.jpa.modeler.spec.MappedSuperclass; //导入依赖的package包/类
@Override
public MappedSuperclass createBaseElementSpec() {
return new MappedSuperclass();
}