Package org.chromattic.api

Examples of org.chromattic.api.ChromatticSession.findById()


         throw new IllegalArgumentException("ProducerInfo '" + producerInfo.getId()
            + "' hasn't been persisted and thus cannot be updated.");
      }

      ChromatticSession session = persister.getSession();
      ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
      if (pim == null)
      {
         throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
      }
      String oldId = pim.getId();
View Full Code Here


      session.save();
      chromatticManager.endRequest(true);

      chromatticManager.beginRequest();
      session = test1LF.getChromattic().openSession();
      foo = session.findById(FooEntity.class, fooId);
      session.close();
      chromatticManager.endRequest(false);

      assertNotNull(foo);
   }
View Full Code Here

   {
      ChromatticSession session = persister.getSession();
      RegistrationSPI registration = null;
      try
      {
         ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
         RegistrationMapping rm = cm.createAndAddRegistrationMappingFrom(null);
         registration = newRegistrationSPI(consumer, registrationProperties, rm.getPersistentKey());
         rm.initFrom(registration);
         persister.closeSession(session, true);
      }
View Full Code Here

   }

   private void remove(String id, Class clazz)
   {
      ChromatticSession session = persister.getSession();
      session.remove(session.findById(clazz, id));
      persister.closeSession(session, true);
   }

   @Override
   protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
View Full Code Here

      ConsumerSPI consumerSPI = super.internalSaveChangesTo(consumer);

      ChromatticSession session = persister.getSession();
      try
      {
         ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
         cm.initFrom(consumer);
         persister.closeSession(session, true);
      }
      catch (Exception e)
      {
View Full Code Here

      try
      {
         ChromatticSession session = persister.getSession();

         // retrieve the mapping associated with the persistence key and if it exists, reset it to the data of the specified ProducerInfo
         ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
         if (pim == null)
         {
            throw new IllegalArgumentException("Couldn't find ProducerInfoMapping associated with key " + key);
         }
         oldId = pim.getId();
View Full Code Here

      if (reg != null)
      {
         try
         {
            final ChromatticSession session = persister.getSession();
            final RegistrationMapping mapping = session.findById(RegistrationMapping.class, registrationId);
            session.remove(mapping);
            persister.save();
         }
         finally
         {
View Full Code Here

      RegistrationSPI registration = super.internalCreateRegistration(consumer, registrationProperties);
      try
      {
         ChromatticSession session = persister.getSession();

         ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
         RegistrationMapping rm = cm.createAndAddRegistrationMappingFrom(null);
         rm.initFrom(registration);
         registration.setPersistentKey(rm.getPersistentKey());

         persister.save();
View Full Code Here

      try
      {
         ChromatticSession session = persister.getSession();

         ConsumerMapping cm = session.findById(ConsumerMapping.class, consumer.getPersistentKey());
         cm.initFrom(consumerSPI);

         persister.save();
      }
      catch (Exception e)
View Full Code Here

      try
      {
         ChromatticSession session = persister.getSession();

         RegistrationMapping cm = session.findById(RegistrationMapping.class, registration.getPersistentKey());
         cm.initFrom(registrationSPI);

         persister.save();
      }
      catch (Exception e)
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.