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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:25:12+00:00 2026-05-21T10:25:12+00:00

I have a Recipe entity that contains two images: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable=true) public

  • 0

I have a Recipe entity that contains two images:

@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class Recipe {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    @Persistent
    private MyImage myImage; // full-size image
    @Persistent
    private MyImage thumb; // 224x230 thumbnail version of the above

    public Recipe(Key userKey, String title, Text content, MyImage myImage, MyImage thumb, Set<String> tags) {
        this.userKey = userKey;
        this.title = title;
        this.content = content;
        this.myImage = myImage;
        this.thumb = thumb;
        this.tags = tags;
    }
    public MyImage getMyImage() {
        return myImage;
    }
    public void setMyImage(MyImage myImage) {
        this.myImage = myImage;
    }
    public MyImage getThumb() {
        return thumb;
    }
    public void setThumb(MyImage thumb) {
        this.thumb = thumb;
    }
}

When I persist this to the datastore, the images are stored correctly.
However the issue comes when I try referencing the images using
.getMyImage() and .getThumb().
They both point to the same object even though I can see in the
datastore viewer that they are two images of different size. If they
are stored in the datastore corretly this means that there’s an issue
with how I reference the object I suppose. Why is this?

This is the object I persist, and as you can see the myImage and
thumb objects are different (not showing the code for them, but
trust me they are).

Recipe recipe = new Recipe(user.getKey(), title, new Text(content), myImage, thumb, tagsAsStrings);

Any ideas why I keep on referencing the same object?

  • 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-21T10:25:13+00:00Added an answer on May 21, 2026 at 10:25 am

    I realized that my logs were showing “This is not yet supported.”. It’s a pity that this feature is not supported, however I had a simple workaround.

    Instead of:

    @Persistent
    private MyImage myImage; // full-size image
    @Persistent
    private MyImage thumb; // 224x230 thumbnail version of the above
    

    I put:

    private List<MyImage> images; // contains 2 elements
                                  // index 0 full-size, 1 is thumbnail (224x230);
                                  // since JDO app-engine doesn't support
                                  // 2 attributes of the same type
    

    So basically a list of two images instead of two distinct images. This works!

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

Sidebar

Related Questions

I have a core data recipe object that contains an ordered list of ingredient
Basically I have a proof-of-concept application that is a digital recipe book. Each Recipe
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
I have an entity context that includes three tables. The first is a table
ruby 1.9.2p290 rails 3.1.1 I have two models: RECIPE and RECIPE_CATEGORY with belongs_to and
I have created a model POCO class called Recipe ; a corresponding RecipeRepository persists
For example, let's assume that i have two QuerySEt objects: queryset1 = my_model1.objects.all().order_by('-created') queryset2
I have a base recipe class and I am using a datacontext. I overrode
I have a Recipe model, which has Ingredients embedded in it, using Mongoid. class
The problem is the next: I have a recipe with images, and I have

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.