-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Custom Persiter can be used in Query?
PostPosted: Thu Mar 15, 2007 6:06 am 
Newbie

Joined: Sun May 28, 2006 1:09 pm
Posts: 2
Hello Hibernate Team,
is it possible to use my own custom persiter for FOO class and use find or any other retrieval api using HQL to lookup my FOO class.

For example i have modified your MasterDetailTest#testCustomPersiter


Code:
   public void testCustomPersister() throws Exception {
      Session s = openSession();
      Custom c = new Custom();
      c.setName( "foo" );
      c.id="100";
      String id = (String) s.save(c);
      assertTrue( c==s.load(Custom.class, id) );
      s.flush();
      s.close();
      
       
        s = openSession();
      List<Custom>cList = (List<Custom>) s.find("from org.hibernate.test.legacy.Custom");
                assertFalse(cList.isEmpty());
      s.flush();
      s.close();
      

   }


First i save object,
second i want to find it, but not using load, but using normal HQL. This doesn't work for me. It shows me an error: no persistent classes found for query class: from org.hibernate.test.legacy.Custom

Is it possible do it somethink like that? And if yes, is it possible to use HQL to retrieve non jdbc persitent object also in master detail or any strange relations.

I need to store some entities into non jdbc storage and major of them in normal jdbc storage.

_________________
Best regards,
Andrej Zachar


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.