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 8379743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:16:26+00:00 2026-06-09T16:16:26+00:00

So if I declare a private member such as private MyObject test; I want

  • 0

So if I declare a private member such as

private MyObject test;

I want to create a template that will generate code in the following format

public MyObject retrieveAllMyObjects() {
    return test.findAll();
}

I have been messing around with the templates but I can’t even figure out how to activate the templates. when I do the Ctrl+Space i just get no template proposals message

public ${return_type} retrieveAll${field}s() {

}

Obviously this is just a starting point, i was just trying to see if i could get eclipse to generate this and then I would go from there, but no such luck. My template doesn’t show up anywhere. The context im using is “Java Type Members” what am I doing wrong??

  • 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-06-09T16:16:27+00:00Added an answer on June 9, 2026 at 4:16 pm

    Maybe you are happy with this solution:

    private ${type} ${name};
    
    public ${type} retrieveAll${type}s() {
        return  ${name}.findAll();
    }
    

    How to use it:

    1. Set up a code template with name ‘retrieveAll’
    2. Go to your class
    3. type ‘ret’
    4. hit <ctrl>+<space>
    5. select retrieveAll
    6. <Enter>
    7. type your desired Type, e.g. String
    8. <Tab>
    9. type your desired field name, e.g. test
    10. <Enter>
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can declare private static member variables in a class, but what does it
I am trying to declare a private Data Structure such as the Vector in
I declare array like that private double[] array = new double[length] . Is it
Why would anyone declare a constructor protected? I know that constructors are declared private
I want to declare a dictionary that stores typed IEnumerable 's of a specific
When declaring a code-behind method as private (such as an event handler), the compiler
I'm working with play. I defined a private member in my model, hoping that
If I create a class MyClass and it has some private member say MyOtherClass,
I'm evaluating selfish and am wondering how I can declare private methods/fields?
Should we declare the private fields as volatile if the instanced are used in

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.