com.liferay.portal.kernel.dao.orm.Query.uniqueResult()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(11.4k)|赞(0)|评价(0)|浏览(345)

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

Query.uniqueResult介绍

暂无

代码示例

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm data provider instance links.
  3. *
  4. * @return the number of ddm data provider instance links
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMDATAPROVIDERINSTANCELINK);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm structure layouts.
  3. *
  4. * @return the number of ddm structure layouts
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURELAYOUT);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm structure versions.
  3. *
  4. * @return the number of ddm structure versions
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTUREVERSION);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm form instance records.
  3. *
  4. * @return the number of ddm form instance records
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCERECORD);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.journal.service

  1. /**
  2. * Returns the number of journal feeds.
  3. *
  4. * @return the number of journal feeds
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_JOURNALFEED);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm structure links.
  3. *
  4. * @return the number of ddm structure links
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURELINK);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.journal.service

  1. /**
  2. * Returns the number of journal folders.
  3. *
  4. * @return the number of journal folders
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_JOURNALFOLDER);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm form instance record versions.
  3. *
  4. * @return the number of ddm form instance record versions
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCERECORDVERSION);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm form instance versions.
  3. *
  4. * @return the number of ddm form instance versions
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMFORMINSTANCEVERSION);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm template links.
  3. *
  4. * @return the number of ddm template links
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATELINK);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.journal.service

  1. /**
  2. * Returns the number of journal article localizations.
  3. *
  4. * @return the number of journal article localizations
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_JOURNALARTICLELOCALIZATION);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm structures.
  3. *
  4. * @return the number of ddm structures
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMSTRUCTURE);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm storage links.
  3. *
  4. * @return the number of ddm storage links
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMSTORAGELINK);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm templates.
  3. *
  4. * @return the number of ddm templates
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATE);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. /**
  2. * Returns the number of ddm template versions.
  3. *
  4. * @return the number of ddm template versions
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_DDMTEMPLATEVERSION);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.journal.service

  1. /**
  2. * Returns the number of journal content searchs.
  3. *
  4. * @return the number of journal content searchs
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_JOURNALCONTENTSEARCH);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.journal.service

  1. /**
  2. * Returns the number of journal article resources.
  3. *
  4. * @return the number of journal article resources
  5. */
  6. @Override
  7. public int countAll() {
  8. Long count = (Long)finderCache.getResult(_finderPathCountAll,
  9. FINDER_ARGS_EMPTY, this);
  10. if (count == null) {
  11. Session session = null;
  12. try {
  13. session = openSession();
  14. Query q = session.createQuery(_SQL_COUNT_JOURNALARTICLERESOURCE);
  15. count = (Long)q.uniqueResult();
  16. finderCache.putResult(_finderPathCountAll, FINDER_ARGS_EMPTY,
  17. count);
  18. }
  19. catch (Exception e) {
  20. finderCache.removeResult(_finderPathCountAll, FINDER_ARGS_EMPTY);
  21. throw processException(e);
  22. }
  23. finally {
  24. closeSession(session);
  25. }
  26. }
  27. return count.intValue();
  28. }

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. count = (Long)q.uniqueResult();

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. count = (Long)q.uniqueResult();

代码示例来源:origin: com.liferay/com.liferay.dynamic.data.mapping.service

  1. count = (Long)q.uniqueResult();

相关文章