本文整理汇总了Java中org.eclipse.persistence.exceptions.ValidationException类的典型用法代码示例。如果您正苦于以下问题:Java ValidationException类的具体用法?Java ValidationException怎么用?Java ValidationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationException类属于org.eclipse.persistence.exceptions包,在下文中一共展示了ValidationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:jeddict,项目名称:jeddict,代码行数:28,代码来源:JPAMTableDefinition.java
示例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;
}
开发者ID:jmrunge,项目名称:osiris-platform,代码行数:25,代码来源:StandardSequence.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:14,代码来源:ManyToManySpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:EntitySpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:EntitySpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:EntitySpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:14,代码来源:OneToOneSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:DefaultClassSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:DefaultClassSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:14,代码来源:ManyToOneSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:EmbeddableSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:EmbeddableSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:14,代码来源:OneToManySpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:MappedSuperclassSpecAccessor.java
示例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;
}
}
开发者ID:jeddict,项目名称:jCode,代码行数:11,代码来源:MappedSuperclassSpecAccessor.java
示例16: connectToDataSource
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
/**
* Connect with the specified properties and return the Connection.
*/
public Connection connectToDataSource(EISAccessor accessor, Properties properties) throws DatabaseException, ValidationException {
if (this.connectionFactory == null && this.name == null) {
this.connectionFactory = new DemoConnectionFactory();
}
if (!properties.isEmpty()) {
if (this.connectionSpec == null) {
this.connectionSpec = new DemoJCAConnectionSpec();
}
}
return super.connectToDataSource(accessor, properties);
}
开发者ID:rhulha,项目名称:EclipseLinkNoSQLDemoPlugin,代码行数:15,代码来源:DemoConnectionSpec.java
示例17: createUniqueConstraintsOnDatabase
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
void createUniqueConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException {
if ((!session.getPlatform().supportsUniqueKeyConstraints())
|| getUniqueKeys().isEmpty()
|| session.getPlatform().requiresUniqueConstraintCreationOnTableCreate()) {
return;
}
for (UniqueKeyConstraint uniqueKey : getUniqueKeys()) {
session.priviledgedExecuteNonSelectingCall(new org.eclipse.persistence.queries.SQLCall(buildUniqueConstraintCreationWriter(session, uniqueKey, new StringWriter()).toString()));
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMTableDefinition.java
示例18: createForeignConstraintsOnDatabase
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
@Override
void createForeignConstraintsOnDatabase(final AbstractSession session) throws ValidationException, DatabaseException {
if ((!session.getPlatform().supportsForeignKeyConstraints()) || getForeignKeyMap().isEmpty()) {
return;
}
for (ForeignKeyConstraint foreignKey : getForeignKeyMap().values()) {
if (!foreignKey.disableForeignKey()) {
session.priviledgedExecuteNonSelectingCall(new SQLCall(buildConstraintCreationWriter(session, foreignKey, new StringWriter()).toString()));
}
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMTableDefinition.java
示例19: appendToDDLWriter
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
public void appendToDDLWriter(Writer schemaWriter, String stringToWrite) {
if (schemaWriter == null) {
return; //do nothing. Ignore append request
}
try {
schemaWriter.write(stringToWrite);
schemaWriter.flush();
} catch (java.io.IOException ioException) {
throw ValidationException.fileError(ioException);
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMSchemaManager.java
示例20: closeDDLWriter
import org.eclipse.persistence.exceptions.ValidationException; //导入依赖的package包/类
public void closeDDLWriter(Writer schemaWriter) {
if (schemaWriter == null) {
return;
}
try {
schemaWriter.flush();
schemaWriter.close();
} catch (java.io.IOException ioException) {
throw ValidationException.fileError(ioException);
}
}
开发者ID:jeddict,项目名称:jeddict,代码行数:13,代码来源:JPAMSchemaManager.java
注:本文中的org.eclipse.persistence.exceptions.ValidationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论