本文整理了Java中org.eclipse.persistence.internal.helper.Helper.arrayFromVector()
方法的一些代码示例,展示了Helper.arrayFromVector()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.arrayFromVector()
方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:arrayFromVector
[英]Convert the specified vector into an array.
[中]将指定的向量转换为数组。
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
protected void sortMethods() {
//Object methodArray[] = getMethods().toArray();
Object[] methodArray = Helper.arrayFromVector(getMethods());
Comparator comparison = new Comparator() {
@Override
public int compare(Object first, Object second) {
if (((MethodDefinition)first).isConstructor()) {
return -1;
} else if (((MethodDefinition)second).isConstructor()) {
return 1;
} else {
return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
}
}
};
Arrays.sort(methodArray, comparison);
Vector sortedMethods = new Vector(getMethods().size());
for (int index = 0; index < methodArray.length; index++) {
sortedMethods.addElement(methodArray[index]);
}
setMethods(sortedMethods);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
protected void sortMethods() {
//Object methodArray[] = getMethods().toArray();
Object[] methodArray = Helper.arrayFromVector(getMethods());
Comparator comparison = new Comparator() {
public int compare(Object first, Object second) {
if (((MethodDefinition)first).isConstructor()) {
return -1;
} else if (((MethodDefinition)second).isConstructor()) {
return 1;
} else {
return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
}
}
};
Arrays.sort(methodArray, comparison);
Vector sortedMethods = new Vector(getMethods().size());
for (int index = 0; index < methodArray.length; index++) {
sortedMethods.addElement(methodArray[index]);
}
setMethods(sortedMethods);
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
protected void sortMethods() {
//Object methodArray[] = getMethods().toArray();
Object[] methodArray = Helper.arrayFromVector(getMethods());
Comparator comparison = new Comparator() {
public int compare(Object first, Object second) {
if (((MethodDefinition)first).isConstructor()) {
return -1;
} else if (((MethodDefinition)second).isConstructor()) {
return 1;
} else {
return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
}
}
};
Arrays.sort(methodArray, comparison);
Vector sortedMethods = new Vector(getMethods().size());
for (int index = 0; index < methodArray.length; index++) {
sortedMethods.addElement(methodArray[index]);
}
setMethods(sortedMethods);
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* INTERNAL:
* Build the appropriate field value for the specified
* set of direct values.
* The database better be expecting an ARRAY.
*/
public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
Object[] fields = Helper.arrayFromVector(directValues);
try {
((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
} catch (java.sql.SQLException ex) {
throw DatabaseException.sqlException(ex, session, false);
} finally {
((DatabaseAccessor)session.getAccessor()).decrementCallCount();
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* INTERNAL:
* Build the appropriate field value for the specified
* set of direct values.
* The database better be expecting an ARRAY.
*/
@Override
public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
Object[] fields = Helper.arrayFromVector(directValues);
try {
((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
} catch (java.sql.SQLException ex) {
throw DatabaseException.sqlException(ex, session, false);
} finally {
((DatabaseAccessor)session.getAccessor()).decrementCallCount();
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* INTERNAL:
* Build the appropriate field value for the specified
* set of direct values.
* The database better be expecting an ARRAY.
*/
@Override
public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
Object[] fields = Helper.arrayFromVector(directValues);
try {
((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
} catch (java.sql.SQLException ex) {
throw DatabaseException.sqlException(ex, session, false);
} finally {
((DatabaseAccessor)session.getAccessor()).decrementCallCount();
}
}
内容来源于网络,如有侵权,请联系作者删除!