本文整理汇总了Java中org.eclipse.persistence.exceptions.ValidationException类的典型用法代码示例。如果您正苦于以下问题:Java ValidationException类的具体用法?Java ValidationException怎么用?Java ValidationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationException类属于org.eclipse.persistence.exceptions包,在下文中一共展示了ValidationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildDBTable
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
/**
* INTERNAL: Return the create table object.
*/
public void buildDBTable(AbstractSession session, DBMapping dbMapping) throws ValidationException {
DBTable dBTable;
Entity entity = (Entity) intrinsicEntity.get(0);
Table table;
if (attribute instanceof RelationAttribute) {
dBTable = new DBRelationTable(getFullName(), entity, (RelationAttribute) attribute);//Todo pass managedClass
} else if (attribute instanceof ElementCollection) {
dBTable = new DBCollectionTable(getFullName(), entity, (ElementCollection) attribute);
} else if((table = entity.getTable(getFullName())) instanceof SecondaryTable){
dBTable = new DBSecondaryTable(getFullName(), entity, (SecondaryTable)table);
} else {
dBTable = new DBBaseTable(getFullName(), entity);
}
dBTable.setId(NBModelerUtil.getAutoGeneratedStringId());
for (Iterator<FieldDefinition> itetrator = getFields().iterator(); itetrator.hasNext();) {
JPAMFieldDefinition field = (JPAMFieldDefinition) itetrator.next();
field.buildDBColumn(dBTable, session, this);
}
dbMapping.addTable(dBTable);
}
示例2: createVector
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
/**
* INTERNAL:
* given sequence = 10, size = 5 will create Vector (6,7,8,9,10)
* @param seqName String is sequencing number field name
* @param size int size of Vector to create.
*/
protected Vector createVector(Number sequence, String seqName, int size) {
long nextSequence = sequence.longValue();
Vector sequencesForName = new Vector(size);
nextSequence = nextSequence - size;
// Check for incorrect values return to validate that the sequence is setup correctly.
// PRS 36451 intvalue would wrap
if (nextSequence < -1L) {
throw ValidationException.sequenceSetupIncorrectly(seqName);
}
for (int index = size; index > 0; index--) {
nextSequence = nextSequence + 1L;
sequencesForName.add(nextSequence);
}
return sequencesForName;
}
示例3: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try{
super.process();
getMapping().setProperty(Attribute.class, manyToMany);
getMapping().setProperty(Inheritance.class, inherit);//Remove inherit functionality , once eclipse support dynamic mapped super class
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(manyToMany.getJavaClass());
exception.setAttribute(manyToMany);
throw exception;
}
}
示例4: addMultipleTableKeyFields
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
protected void addMultipleTableKeyFields(List<PrimaryKeyJoinColumnMetadata> primaryKeyJoinColumns, DatabaseTable targetTable, String PK_CTX, String FK_CTX) {
try {
super.addMultipleTableKeyFields(primaryKeyJoinColumns, targetTable, PK_CTX, FK_CTX);
} catch (ValidationException ex) {// to handle @PrimaryKeyJoinColumn exception
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(entity);
throw exception;
}
}
示例5: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try {
super.process();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(entity);
throw exception;
}
}
示例6: processVirtualClass
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
protected void processVirtualClass() {
try {
super.processVirtualClass();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(entity);
throw exception;
}
}
示例7: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try{
super.process();
getMapping().setProperty(Attribute.class, oneToOne);
getMapping().setProperty(Inheritance.class, inherit);//Remove inherit functionality , once eclipse support dynamic mapped super class
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(oneToOne.getJavaClass());
exception.setAttribute(oneToOne);
throw exception;
}
}
示例8: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try {
super.process();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(defaultClass);
throw exception;
}
}
示例9: processVirtualClass
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
protected void processVirtualClass() {
try {
super.processVirtualClass();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(defaultClass);
throw exception;
}
}
示例10: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try {
super.process();
getMapping().setProperty(Attribute.class, manyToOne);
getMapping().setProperty(Inheritance.class, inherit);//Remove inherit functionality , once eclipse support dynamic mapped super class
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(manyToOne.getJavaClass());
exception.setAttribute(manyToOne);
throw exception;
}
}
示例11: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try {
super.process();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(embeddable);
throw exception;
}
}
示例12: processVirtualClass
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
protected void processVirtualClass() {
try {
super.processVirtualClass();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(embeddable);
throw exception;
}
}
示例13: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try{
super.process();
getMapping().setProperty(Attribute.class, oneToMany);
getMapping().setProperty(Inheritance.class, inherit);//Remove inherit functionality , once eclipse support dynamic mapped super class
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(oneToMany.getJavaClass());
exception.setAttribute(oneToMany);
throw exception;
}
}
示例14: process
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
public void process() {
try {
super.process();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(mappedSuperclass);
throw exception;
}
}
示例15: processVirtualClass
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
protected void processVirtualClass() {
try {
super.processVirtualClass();
} catch (ValidationException ex) {
DBValidationException exception = new DBValidationException(ex);
exception.setJavaClass(mappedSuperclass);
throw exception;
}
}