Examples of findOne()


Examples of org.fao.geonet.repository.UserRepository.findOne()

   * @throws UserNotFoundEx  if the id does not reference a user
   */
  public static User updatePasswordWithNew(boolean matchOldPassword, String oldPassword,
      String newPassword, Integer iUserId, ApplicationContext appContext) throws SQLException, UserNotFoundEx {
      UserRepository repo = appContext.getBean(UserRepository.class);
        User user = repo.findOne(iUserId);
        if (user == null) {
            throw new UserNotFoundEx(""+iUserId);
        }

        PasswordEncoder encoder = encoder(appContext);
View Full Code Here

Examples of org.jongo.MongoCollection.findOne()

        Friend friend = new Friend("Peter", "31 rue des Lilas");
        friends.save(friend);

        friends.update(friend.getId()).with(new Friend("John"));

        Friend updated = friends.findOne().as(Friend.class);
        assertThat(updated.getName()).isEqualTo("John");
        assertThat(updated.getAddress()).isNull();
    }

    private static class Party {
View Full Code Here

Examples of org.lightadmin.core.persistence.repository.DynamicJpaRepository.findOne()

        DynamicJpaRepository repository = domainTypeConfiguration.getRepository();

        PersistentEntity persistentEntity = domainTypeConfiguration.getPersistentEntity();
        Serializable id = (Serializable) conversionService.convert(entityId, persistentEntity.getIdProperty().getActualType());

        return repository.findOne(id);
    }

    private void addDomainTypeConfigurationToModel(String domainTypeName, Model model) {
        model.addAttribute(DOMAIN_TYPE_ADMINISTRATION_CONFIGURATION_KEY, configuration.forEntityName(domainTypeName));
        model.addAttribute(BEAN_FACTORY_KEY, appContext.getAutowireCapableBeanFactory());
View Full Code Here

Examples of org.mongodb.morphia.testdaos.HotelDAO.findOne()

        final Hotel hotelLoaded = hotelDAO.get(borg.getId());
        assertEquals(borg.getName(), hotelLoaded.getName());
        assertEquals(borg.getAddress().getPostCode(), hotelLoaded.getAddress().getPostCode());

        final Hotel hotelByValue = hotelDAO.findOne("name", "Hotel Borg");
        assertNotNull(hotelByValue);
        assertEquals(borg.getStartDate(), hotelByValue.getStartDate());

        assertTrue(hotelDAO.exists("stars", 4));
View Full Code Here

Examples of org.ngrinder.script.repository.FileEntryRepository.findOne()

      FileType fileType = eachFileEntry.getFileType();
      if (fileType.isLibDistributable()) {
        fileList.add(eachFileEntry);
      }
    }
    fileList.add(fileEntryRepository.findOne(user, basePath + "/pom.xml", SVNRevision.create(revision)));
    return fileList;
  }

  @Override
  protected String calcDistSubPath(String basePath, FileEntry each) {
View Full Code Here

Examples of org.nutz.mongo.MongoDao.findOne()

    dao.create(SystemConfig.class, false);
    dao.create(App.class, false);
    dao.create(Role.class, false);
   
    //创建匿名用户
    User anonymous = dao.findOne(User.class, new BasicDBObject("provider", "anonymous"));
    if (anonymous == null) {
      anonymous = new User();
      anonymous.setProvider("anonymous");
      dao.save(anonymous);
    }
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findOne()

            throw new GeneralException("Method writeText() only supports rendering text content : " + targetMimeTypeId + " is not supported");
        }

        if ("text/html".equals(targetMimeTypeId)) {
            // get the default mime type template
            GenericValue mimeTypeTemplate = delegator.findOne("MimeTypeHtmlTemplate", UtilMisc.toMap("mimeTypeId", dataResourceMimeTypeId), true);

            if (mimeTypeTemplate != null && mimeTypeTemplate.get("templateLocation") != null) {
                // prepare the context
                Map<String, Object> mimeContext = FastMap.newInstance();
                mimeContext.putAll(context);
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findOne()

            String text = "";

            if ("SHORT_TEXT".equals(dataResourceTypeId) || "LINK".equals(dataResourceTypeId)) {
                text = dataResource.getString("objectInfo");
            } else if ("ELECTRONIC_TEXT".equals(dataResourceTypeId)) {
                GenericValue electronicText = delegator.findOne("ElectronicText", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
                if (electronicText != null) {
                    text = electronicText.getString("textData");
                }
            } else {
                throw new GeneralException("Unsupported TEXT type; cannot stream");
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findOne()

        } else if (dataResourceTypeId.endsWith("_OBJECT")) {
            byte[] bytes = new byte[0];
            GenericValue valObj;

            if ("IMAGE_OBJECT".equals(dataResourceTypeId)) {
                valObj = delegator.findOne("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
                if (valObj != null) {
                    bytes = valObj.getBytes("imageData");
                }
            } else if ("VIDEO_OBJECT".equals(dataResourceTypeId)) {
                valObj = delegator.findOne("VideoDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
View Full Code Here

Examples of org.ofbiz.entity.Delegator.findOne()

                valObj = delegator.findOne("ImageDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
                if (valObj != null) {
                    bytes = valObj.getBytes("imageData");
                }
            } else if ("VIDEO_OBJECT".equals(dataResourceTypeId)) {
                valObj = delegator.findOne("VideoDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
                if (valObj != null) {
                    bytes = valObj.getBytes("videoData");
                }
            } else if ("AUDIO_OBJECT".equals(dataResourceTypeId)) {
                valObj = delegator.findOne("AudioDataResource", UtilMisc.toMap("dataResourceId", dataResourceId), cache);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.