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

  • Home
  • SEARCH
  • 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 766327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:01:47+00:00 2026-05-14T17:01:47+00:00

I have the following class objects in Google App Engine’s dadastore, I can see

  • 0

I have the following class objects in Google App Engine’s dadastore, I can see them from the “Datastore Viewer ” :

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class Contact_Info_Entry implements Serializable
{
  @PrimaryKey
  @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
  Long Id;
  public static final long serialVersionUID=26362862L;
  String Contact_Id="",First_Name="",Last_Name="",Company_Name="",Branch_Name="",Address_1="",Address_2="",City="",State="",Zip="",Country="";
  double D_1,D_2;
  boolean B_1,B_2;
  Vector<String> A_Vector=new Vector<String>();

  public Contact_Info_Entry() { }
......
}

How can my java applications get the object from a servlet url ? For instance if have an instance of Contact_Info_Entry who’s Contact_Id is “ABC-123”, and my App Id is : nm-java

When my java program accesses the url :

 "http://nm-java.appspot.com/Check_Contact_Info?Contact_Id=ABC-123

How will the Check_Contact_Info servlet get the object from datastore and return it to my app ?

public class Check_Contact_Info_Servlet extends HttpServlet
{
  static boolean Debug=true;

  public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException
  {

  }
...
  protected void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException { doGet(request,response); }
}

Sorry I need to be more specific, how to send the object out in the response ?

  public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException
  {
    PrintWriter out=response.getWriter();

    Contact_Info_Entry My_Contact_Entry;
    ... get My_Contact_Entry from datastore ...

    ??? How to send it out in the "response" ???


  }

Frank

  • 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-14T17:01:47+00:00Added an answer on May 14, 2026 at 5:01 pm

    Since Contact_Id is not the primary key, you need to create a query:

    Query query = pm.newQuery(Contact_Info_Entry.class);
    query.setFilter("Contact_Id == idParam");
    query.declareParameters("String idParam");
    
    try {
    
        List<Contact_Info_Entry> results = (List<Contact_Info_Entry>) 
            query.execute("ABC-123");
    
        // note that this returns a list, there could be multiple,
        // DataStore does not ensure uniqueness for non-primary key fields
    
    } finally {
        query.closeAll();
    }
    

    If you could use the Long Id value (which is the primary key) instead, you could load it directly by entity key.

    If you want to send the entity from the Servlet to a Java client, you could use Java’s serialization (your class is serializable).

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

Sidebar

Related Questions

I'm using Django-nonrel on Google App Engine and have the following models (they are
Using Google App Engine and GQL and Python: in my datastore I have something
I have the following user resource: class UserResource(ModelResource): class Meta: queryset = User.objects.all() resource_name
I have a question on constant objects. In the following program: class const_check{ int
I have a Java Google App Engine web application that allows user upload of
I've been following the google app engine tutorial and the part that explains JDO
I have a class like the following: class Positive(object): def __init__(self, item): self._validate_item(item) self.item
I have the following c# classes: class A : Object { foo() {} }
I have the following problem: I have the class: class Word(object): def __init__(self): self.id
I have the following converter: public class MyConverter : IValueConverter { public object Convert(object

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.