org.eclipse.persistence.internal.helper.Helper.arrayFromVector()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中org.eclipse.persistence.internal.helper.Helper.arrayFromVector()方法的一些代码示例,展示了Helper.arrayFromVector()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Helper.arrayFromVector()方法的具体详情如下:
包路径:org.eclipse.persistence.internal.helper.Helper
类名称:Helper
方法名:arrayFromVector

Helper.arrayFromVector介绍

[英]Convert the specified vector into an array.
[中]将指定的向量转换为数组。

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. protected void sortMethods() {
  2. //Object methodArray[] = getMethods().toArray();
  3. Object[] methodArray = Helper.arrayFromVector(getMethods());
  4. Comparator comparison = new Comparator() {
  5. @Override
  6. public int compare(Object first, Object second) {
  7. if (((MethodDefinition)first).isConstructor()) {
  8. return -1;
  9. } else if (((MethodDefinition)second).isConstructor()) {
  10. return 1;
  11. } else {
  12. return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
  13. }
  14. }
  15. };
  16. Arrays.sort(methodArray, comparison);
  17. Vector sortedMethods = new Vector(getMethods().size());
  18. for (int index = 0; index < methodArray.length; index++) {
  19. sortedMethods.addElement(methodArray[index]);
  20. }
  21. setMethods(sortedMethods);
  22. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. protected void sortMethods() {
  2. //Object methodArray[] = getMethods().toArray();
  3. Object[] methodArray = Helper.arrayFromVector(getMethods());
  4. Comparator comparison = new Comparator() {
  5. public int compare(Object first, Object second) {
  6. if (((MethodDefinition)first).isConstructor()) {
  7. return -1;
  8. } else if (((MethodDefinition)second).isConstructor()) {
  9. return 1;
  10. } else {
  11. return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
  12. }
  13. }
  14. };
  15. Arrays.sort(methodArray, comparison);
  16. Vector sortedMethods = new Vector(getMethods().size());
  17. for (int index = 0; index < methodArray.length; index++) {
  18. sortedMethods.addElement(methodArray[index]);
  19. }
  20. setMethods(sortedMethods);
  21. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. protected void sortMethods() {
  2. //Object methodArray[] = getMethods().toArray();
  3. Object[] methodArray = Helper.arrayFromVector(getMethods());
  4. Comparator comparison = new Comparator() {
  5. public int compare(Object first, Object second) {
  6. if (((MethodDefinition)first).isConstructor()) {
  7. return -1;
  8. } else if (((MethodDefinition)second).isConstructor()) {
  9. return 1;
  10. } else {
  11. return ((MethodDefinition)first).getName().compareTo(((MethodDefinition)second).getName());
  12. }
  13. }
  14. };
  15. Arrays.sort(methodArray, comparison);
  16. Vector sortedMethods = new Vector(getMethods().size());
  17. for (int index = 0; index < methodArray.length; index++) {
  18. sortedMethods.addElement(methodArray[index]);
  19. }
  20. setMethods(sortedMethods);
  21. }

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

  1. /**
  2. * INTERNAL:
  3. * Build the appropriate field value for the specified
  4. * set of direct values.
  5. * The database better be expecting an ARRAY.
  6. */
  7. public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
  8. Object[] fields = Helper.arrayFromVector(directValues);
  9. try {
  10. ((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
  11. java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
  12. return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
  13. } catch (java.sql.SQLException ex) {
  14. throw DatabaseException.sqlException(ex, session, false);
  15. } finally {
  16. ((DatabaseAccessor)session.getAccessor()).decrementCallCount();
  17. }
  18. }

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

  1. /**
  2. * INTERNAL:
  3. * Build the appropriate field value for the specified
  4. * set of direct values.
  5. * The database better be expecting an ARRAY.
  6. */
  7. @Override
  8. public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
  9. Object[] fields = Helper.arrayFromVector(directValues);
  10. try {
  11. ((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
  12. java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
  13. return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
  14. } catch (java.sql.SQLException ex) {
  15. throw DatabaseException.sqlException(ex, session, false);
  16. } finally {
  17. ((DatabaseAccessor)session.getAccessor()).decrementCallCount();
  18. }
  19. }

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

  1. /**
  2. * INTERNAL:
  3. * Build the appropriate field value for the specified
  4. * set of direct values.
  5. * The database better be expecting an ARRAY.
  6. */
  7. @Override
  8. public Object buildFieldValueFromDirectValues(Vector directValues, String elementDataTypeName, AbstractSession session) throws DatabaseException {
  9. Object[] fields = Helper.arrayFromVector(directValues);
  10. try {
  11. ((DatabaseAccessor)session.getAccessor()).incrementCallCount(session);
  12. java.sql.Connection connection = ((DatabaseAccessor)session.getAccessor()).getConnection();
  13. return session.getPlatform().createArray(elementDataTypeName, fields, session,connection);
  14. } catch (java.sql.SQLException ex) {
  15. throw DatabaseException.sqlException(ex, session, false);
  16. } finally {
  17. ((DatabaseAccessor)session.getAccessor()).decrementCallCount();
  18. }
  19. }

相关文章

Helper类方法