-->
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.  [ 4 posts ] 
Author Message
 Post subject: Multiple image upload issue
PostPosted: Sat Jan 20, 2007 6:52 am 
Newbie

Joined: Sat Jan 20, 2007 6:37 am
Posts: 2
Image update issue . My image does not get updated . I got a domain object PhoneInfo which has got 2 blob fields - phonethumbnail and phoneenlarged. I do a save or update one by one . Initially the thumbnail and then the enlarged.Still i find that only the recent one gets updated.

Code:

public void saveOrUpdate(PhoneInformation phoneInfo) {
       // check for ecach object if it is null specially for gfk import in which some time marke,
       // display and some other object are null
       
       Session session;
      try {
         session = getSessionFactory().openSession();
      
      if(null == phoneInfo.getDisplay()){
          phoneInfo.setDisplay(new Display());
          phoneInfo.getDisplay().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getDeviceDescription()){
          phoneInfo.setDeviceDescription(new DeviceDescription());
          phoneInfo.getDeviceDescription().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getUserInterface()){
          phoneInfo.setUserInterface(new UserInterface());
          phoneInfo.getUserInterface().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getMessaging()){
          phoneInfo.setMessaging(new Messaging());
          phoneInfo.getMessaging().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getBattery()){
          phoneInfo.setBattery(new Battery());
          phoneInfo.getBattery().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getCamera()){
          phoneInfo.setCamera(new Camera());
          phoneInfo.getCamera().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getVideo()){
          phoneInfo.setVideo(new Video());
          phoneInfo.getVideo().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getJavaBrewGame()){
          phoneInfo.setJavaBrewGame(new JavaBrewGame());
          phoneInfo.getJavaBrewGame().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getMemory()){
          phoneInfo.setMemory(new Memory());
          phoneInfo.getMemory().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getConnectivity()){
          phoneInfo.setConnectivity(new Connectivity());
          phoneInfo.getConnectivity().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getAudio()){
          phoneInfo.setAudio(new Audio());
          phoneInfo.getAudio().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getVideo()){
          phoneInfo.setVideo(new Video());
          phoneInfo.getVideo().setPhoneInfo(phoneInfo);
       }
       if(null == phoneInfo.getMarket()){
          phoneInfo.setMarket(new Market());
          phoneInfo.getMarket().setPhoneInfo(phoneInfo);
       }
         // perform conversion of units if needed
        phoneInfo.convertUnits();
        phoneInfo.convertDeviceDescriptionUnits();
        phoneInfo.convertBatteryUnits();
       
           Transaction tx = session.beginTransaction();
         session.saveOrUpdate(phoneInfo);         
         session.flush();
         tx.commit();
         
      } catch (HibernateException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }       
    }

I tried all options still i am unable to update both the blob fields.Please assist..


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 20, 2007 7:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
go to the user forum

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 10:48 am 
Newbie

Joined: Sat Jan 20, 2007 6:37 am
Posts: 2
well max sorry but ..can u tell me what post are you referring to in the users forum i found lots but couldnt find the one appropriate to my issue.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 21, 2007 1:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well your question is a purely usage question - nothing to do with the tools; thus the user forum is the apropriate place to ask, so...

If your posting (or a question you are referring to) was not answered by anybody, the possible reasons are:

- http://www.hibernate.org/ForumMailingli ... AskForHelp
- You did not submit enough information
- Nobody knows the answer or has the free time to answer

What you can do now:

- Do the things listed in After Posting
- Add missing and/or more information
- Consider commercial support for guaranteed expert response times

This is a high-traffic forum run by volunteers with hundreds of postings made every day. The community works because people try to help others in their free time. Nobody is paid for this service or has to pay.

You should not expect a timely response and you should not rely on a public community forum for critical cases.

All community members should respect the rules of this forum and treat others like they would prefer to be treated.

_________________
Max
Don't forget to rate


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

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.