Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7080979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:51:42+00:00 2026-05-28T06:51:42+00:00

I m not very versed in Hibernate and have following query: Consider two classes:

  • 0

I m not very versed in Hibernate and have following query:

Consider two classes:

public class Ticket{

  private List<Attachement> attachmentList=new ArrayList<Attachment>();
  ...
}

public class Attachment{
   private String fileName;
   private bytes[] fileData;
}

consider a scenario:

user opens a ticket to see its details.Along with ticket details list of all attachements related to that ticket will also shown up(i mean only names of attachments). user will click on a filename to download that attachment.

While displaying details of ticket I do not want to fetch the related attachments data until user click on their fienames to download them. (I want to show their names only)

With lazy loading, loading of attachements can be deferred but how to fetch their filenames (‘fileName‘ attribute of class Attachment) earlier only but not the ‘fileData‘.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:51:43+00:00Added an answer on May 28, 2026 at 6:51 am

    You need to write a custom query to load just the names of the attachments. In your application, you should have some sort of TicketService with a loadTicket method on it. In that method, you should load the ticket (and only the ticket), and then just the names of the Attachments that are attached to the ticket.

    Return that data to the UI. When the user clicks an attachment name, you can then load the full Attachment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not very good in SQL and HQL... I have two domains: class Hotel
I appologize I am not very versed in Javascript and jquery but what I
I'm not very good at PHP and would like to have a PHP function
i'm not very well-versed with javascript, so please bear with me. i've a form
I'm not very well versed with regular expressions. I've had to use them, maybe
I am not very well versed in ASP, but that is what my client's
New to SQL Server and not very well-versed in how things run with it.
Though I am not very new to Java, the following questions just confused me
I am not very familiar with using the list function in R. This is
I am not very good with regular expression. I have a string like: var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.