test_class.declarator: server
test_class.modifier: private static
test_class.original_string: private static Server server;
test_class.type: Server
test_class.var_name: server
test_class.declarator: abdera = Abdera.getInstance()
test_class.modifier: private static
test_class.original_string: private static Abdera abdera = Abdera.getInstance();
test_class.type: Abdera
test_class.var_name: abdera
test_class.declarator: client = new AbderaClient()
test_class.modifier: private static
test_class.original_string: private static AbderaClient client = new AbderaClient();
test_class.type: AbderaClient
test_class.var_name: client
test_class.file: adapters/hibernate/src/test/java/org/apache/abdera/protocol/server/adapters/hibernate/HibernateCollectionAdapterTest.java
test_class.identifier: HibernateCollectionAdapterTest
test_case.body: @Test
  	public void testUpdateEntry() {		
  		ClientResponse resp = client.get("http://localhost:9002/hibernate/foo");
  	    Document<Entry> doc = resp.getDocument();
  	    Entry entry = (Entry) doc.getRoot().clone();
  	    entry.setTitle("This is the modified title");
  	    resp.release();
  	    resp = client.put("http://localhost:9002/hibernate/foo", entry);
  	    assertEquals(ResponseType.SUCCESS, resp.getType());
  	    assertEquals(200, resp.getStatus());
  	    resp.release();
  	    resp = client.get("http://localhost:9002/hibernate/foo");
  	    doc = resp.getDocument();
  	    entry = doc.getRoot();
  	    assertEquals("This is the modified title", entry.getTitle());
  	    resp.release();
  	    resp = client.get("http://localhost:9002/hibernate");
  	    Document<Feed> feed_doc = resp.getDocument();
  	    Feed feed = feed_doc.getRoot();
  	    assertEquals(1, feed.getEntries().size());
  	    resp.release();
  	}
test_case.class_method_signature: HibernateCollectionAdapterTest.testUpdateEntry()
test_case.full_signature: @Test public void testUpdateEntry()
test_case.identifier: testUpdateEntry
test_case.invocations: get getDocument clone getRoot setTitle release put assertEquals getType assertEquals getStatus release get getDocument getRoot assertEquals getTitle release get getDocument getRoot assertEquals size getEntries release
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateEntry()
focal_class.declarator: logger = LogFactory.getLog(HibernateCollectionAdapter.class)
focal_class.modifier: private static
focal_class.original_string: private static Log logger = LogFactory.getLog(HibernateCollectionAdapter.class);
focal_class.type: Log
focal_class.var_name: logger
focal_class.declarator: hibernateConfig
focal_class.modifier: protected static
focal_class.original_string: protected static Configuration hibernateConfig;
focal_class.type: Configuration
focal_class.var_name: hibernateConfig
focal_class.declarator: sessionFactory
focal_class.modifier: protected static
focal_class.original_string: protected static SessionFactory sessionFactory;
focal_class.type: SessionFactory
focal_class.var_name: sessionFactory
focal_class.declarator: HIBERNATE_ANNOTATION_CONFIG = "hibernateAnnotationConfig"
focal_class.modifier: public static final
focal_class.original_string: public static final String HIBERNATE_ANNOTATION_CONFIG = "hibernateAnnotationConfig";
focal_class.type: String
focal_class.var_name: HIBERNATE_ANNOTATION_CONFIG
focal_class.declarator: HIBERNATE_CFG_PATH = "hibernateCfgPath"
focal_class.modifier: public static final
focal_class.original_string: public static final String HIBERNATE_CFG_PATH = "hibernateCfgPath";
focal_class.type: String
focal_class.var_name: HIBERNATE_CFG_PATH
focal_class.declarator: ENTRY_MAPPING_CLASS_NAME = "entryMappingClassName"
focal_class.modifier: public static final
focal_class.original_string: public static final String ENTRY_MAPPING_CLASS_NAME = "entryMappingClassName";
focal_class.type: String
focal_class.var_name: ENTRY_MAPPING_CLASS_NAME
focal_class.file: adapters/hibernate/src/main/java/org/apache/abdera/protocol/server/adapters/hibernate/HibernateCollectionAdapter.java
focal_class.identifier: HibernateCollectionAdapter
focal_class.class_method_signature: HibernateCollectionAdapter.HibernateCollectionAdapter(Abdera abdera, FeedConfiguration config)
focal_class.full_signature: public  HibernateCollectionAdapter(Abdera abdera, FeedConfiguration config)
focal_class.identifier: HibernateCollectionAdapter
focal_class.modifiers: public
focal_class.parameters: (Abdera abdera, FeedConfiguration config)
focal_class.signature:  HibernateCollectionAdapter(Abdera abdera, FeedConfiguration config)
focal_class.class_method_signature: HibernateCollectionAdapter.loadHibernateConfiguration()
focal_class.full_signature: private void loadHibernateConfiguration()
focal_class.identifier: loadHibernateConfiguration
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void loadHibernateConfiguration()
focal_class.class_method_signature: HibernateCollectionAdapter.getSessionFactory()
focal_class.full_signature: protected SessionFactory getSessionFactory()
focal_class.identifier: getSessionFactory
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: SessionFactory
focal_class.signature: SessionFactory getSessionFactory()
focal_class.class_method_signature: HibernateCollectionAdapter.rebuildSessionFactory(Configuration cfg)
focal_class.full_signature: private void rebuildSessionFactory(Configuration cfg)
focal_class.identifier: rebuildSessionFactory
focal_class.modifiers: private
focal_class.parameters: (Configuration cfg)
focal_class.return: void
focal_class.signature: void rebuildSessionFactory(Configuration cfg)
focal_class.class_method_signature: HibernateCollectionAdapter.createEntry(Entry entry)
focal_class.full_signature: @Override public Entry createEntry(Entry entry)
focal_class.identifier: createEntry
focal_class.modifiers: @Override public
focal_class.parameters: (Entry entry)
focal_class.return: Entry
focal_class.signature: Entry createEntry(Entry entry)
focal_class.class_method_signature: HibernateCollectionAdapter.deleteEntry(Object entryId)
focal_class.full_signature: @Override public boolean deleteEntry(Object entryId)
focal_class.identifier: deleteEntry
focal_class.modifiers: @Override public
focal_class.parameters: (Object entryId)
focal_class.return: boolean
focal_class.signature: boolean deleteEntry(Object entryId)
focal_class.class_method_signature: HibernateCollectionAdapter.getEntry(Object entryId)
focal_class.full_signature: @Override public Entry getEntry(Object entryId)
focal_class.identifier: getEntry
focal_class.modifiers: @Override public
focal_class.parameters: (Object entryId)
focal_class.return: Entry
focal_class.signature: Entry getEntry(Object entryId)
focal_class.class_method_signature: HibernateCollectionAdapter.getFeed()
focal_class.full_signature: @Override public Feed getFeed()
focal_class.identifier: getFeed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Feed
focal_class.signature: Feed getFeed()
focal_class.class_method_signature: HibernateCollectionAdapter.updateEntry(Object entryId, Entry entry)
focal_class.full_signature: @Override public Entry updateEntry(Object entryId, Entry entry)
focal_class.identifier: updateEntry
focal_class.modifiers: @Override public
focal_class.parameters: (Object entryId, Entry entry)
focal_class.return: Entry
focal_class.signature: Entry updateEntry(Object entryId, Entry entry)
focal_class.class_method_signature: HibernateCollectionAdapter.collectMappingObject(Entry entry, Object forUpdate)
focal_class.full_signature: protected Object collectMappingObject(Entry entry, Object forUpdate)
focal_class.identifier: collectMappingObject
focal_class.modifiers: protected
focal_class.parameters: (Entry entry, Object forUpdate)
focal_class.return: Object
focal_class.signature: Object collectMappingObject(Entry entry, Object forUpdate)
focal_class.class_method_signature: HibernateCollectionAdapter.collectField(Field field, Class clazz, Object mappingObject, Object entryValue)
focal_class.full_signature: protected void collectField(Field field, Class clazz, Object mappingObject, Object entryValue)
focal_class.identifier: collectField
focal_class.modifiers: protected
focal_class.parameters: (Field field, Class clazz, Object mappingObject, Object entryValue)
focal_class.return: void
focal_class.signature: void collectField(Field field, Class clazz, Object mappingObject, Object entryValue)
focal_class.class_method_signature: HibernateCollectionAdapter.getSetter(String fieldName)
focal_class.full_signature: protected String getSetter(String fieldName)
focal_class.identifier: getSetter
focal_class.modifiers: protected
focal_class.parameters: (String fieldName)
focal_class.return: String
focal_class.signature: String getSetter(String fieldName)
focal_class.superclass: extends BasicAdapter
focal_method.body: @Override
  	public Entry updateEntry(Object entryId, Entry entry) throws Exception {
  		Session session = getSessionFactory().openSession();
  		Transaction tx = session.beginTransaction();
  		try {
  			Object forUpdate = session.load(
  					Class.forName((String) config.getProperty(ENTRY_MAPPING_CLASS_NAME)), 
  					(Serializable) entryId);
  			if (forUpdate != null) {
  				forUpdate = collectMappingObject(entry, forUpdate);
  				session.update(forUpdate);
  				tx.commit();
  			}
  		} catch (HibernateException ex) {
  			tx.rollback();
  			logger.error("error deleting the entry", ex);			
  		} finally {
  			session.close();
  		}
  				
  		return entry;
  	}
focal_method.class_method_signature: HibernateCollectionAdapter.updateEntry(Object entryId, Entry entry)
focal_method.full_signature: @Override public Entry updateEntry(Object entryId, Entry entry)
focal_method.identifier: updateEntry
focal_method.invocations: openSession getSessionFactory beginTransaction load forName getProperty collectMappingObject update commit rollback error close
focal_method.modifiers: @Override public
focal_method.parameters: (Object entryId, Entry entry)
focal_method.return: Entry
focal_method.signature: Entry updateEntry(Object entryId, Entry entry)