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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:02:37+00:00 2026-05-27T15:02:37+00:00

I have this entity – I’m trying to determine the type of its properties

  • 0

I have this entity – I’m trying to determine the type of its properties – in Google App Engine’s internal data-types PREFERRED (as opposed to Java data types).
The below code is obviously simplified. In reality I do not know the entity’s properties or anything else about it.

final DatastoreService dss = DatastoreServiceFactory.getDatastoreService();
final Query query = new Query("Person");
final PreparedQuery pq = dss.prepare(query);

for (Entity entity : pq.asIterable())
{
    final Object property = entity.getProperty("some_property");
    // Here I want to determine which data type 'property' represents - GAE-wise.
}

In App Engine’s Java code I’ve found some hints:

DataTypeTranslator
    DataTypeTranslator.typeMap (internal private member)
Property.Meaning.GD_PHONENUMBER

I’m unable to link those together into what I need – some sort of reflection.

I wish I was able to do something like this:

entity.getPropertyType("some_property");

Does anyone know better?

DataTypeTranslator source code here

Edit #1: <<
INGORE this one. It’s me who put these postfixes (I was confused by the doc).

Here’s more important info I’ve found.
I’m getting it in Eclipse’ tool-tip mini-window when I point over an entity (one which I just fetched from the Datastore).
The Datastore seems to send it (this payload) as raw text which is nice, maybe I’ll have to parse it (but, how do I get it from code LOL).
Pay attention to the types in here, it’s written plain simple.
Here it is:

<Entity [Bird(9)]:
    Int64Type:44rmna4kc2g23i9brlupps74ir#Int64Type = 1234567890
    String:igt7qvk9p89nc3gjqn9s3jq69c = 7tns1l48vpttq5ff47i3jlq3f9
    PhoneNumber:auih50aecl574ud23v9h4rfvt1#PhoneNumberType = 03-6491234
    Date:k1qstkn9np0mpb6fp41cj6i3am = Wed Jul 20 23:03:13 UTC 2011
>

For example, property named String:igt7qvk9p89nc3gjqn9s3jq69c has the value of 7tns1l48vpttq5ff47i3jlq3f9 and it doesn’t tell its type. Also property Date:k1qstkn9np0mpb6fp41cj6i3am.
Property named Int64Type:44rmna4kc2g23i9brlupps74ir has the value of “1234567890” and here it strictly mentions that the data type is of “Int64Type”.

  • 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-27T15:02:38+00:00Added an answer on May 27, 2026 at 3:02 pm

    I’m searching for it too.

    It’s a bit of a hack, but at least my output includes the type (without needing a secret decoder ring). But my code is slightly different:

    Query allusersentityquery = new Query();
    allusersentityquery.setAncestor(userKey);
    
    for (final Entity entity : datastore.prepare(allusersentityquery).asIterable()) {
        Map<String, Object> properties = entity.getProperties();
        String[] propertyNames = properties.keySet().toArray(
            new String[properties.size()]);
    
        for(final String propertyName : propertyNames) {
          // propertyNames string contains
          // "com.google.appengine.api.datastore.PostalAddress" if it is a Postal Address
        }
    }
    

    There seems to be no documents about determining the Property Types here.

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

Sidebar

Related Questions

I have this type of data: entity, account, month1, month2, ..., month12 abc, 2000.02,
I have an entity class. This entity has lots of properties and entity's data
I have this entity service in my domain model with two datetime type properties
I have this error message could not load assembly 'system.data.entity, version 4.2.0.0, culture=neutral,publickeytoken=b77a5c561934e089' or
I am trying to serialize entities for mobile digest. I have this Entity class:
I have this file: #src/Jander/JanderBundle/resources/config/doctrine/metadata/orm/ Propuestas.orm.yml Propuestas: type: entity table: propuestas fields: id: id:
I have this: public class DbContext : System.Data.Entity.DbContext, IDbContext { } My Ninject configuration:
Let's say I have this entity (for Hibernate): @Entity public class Person { @Id
If I have this entity: @Entity class Pet { @Id long id; public enum
I have this piece of code: @Entity @Table(name = MOVERS) public class MOVers implements

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.