Store multiple rows in a single key.

41 views
Skip to first unread message

Spmadhu Priya

unread,
Nov 20, 2015, 6:50:22 AM11/20/15
to Google App Engine
Hi!

I am doing internship in a company.
I am beginner to java.
I am developing the timetable project.
I want to store the below form when i am submitting the form .I know that i can store the single row at a time but i want to store multiple store at a time using JDO.
Thanks  in advance.

My form design is 
Day 1 2 3 4 5
Day 1 Value1 Value1 Value1 Value1 Value1
Day 2 Value2 Value2 Value2 Value2 Value2
Day 3 Value3 Value3 Value3 Value3 Value3
Day 4 Value4 Value4 Value4 Value4 Value4
Day 5 Value5 Value5 Value5 Value5 Value5
Day 6 Value6 Value6 Value6 Value6 Value6









Patrice (Cloud Platform Support)

unread,
Nov 20, 2015, 10:27:37 AM11/20/15
to Google App Engine
Hi Spmadhu,

There are a couple of ways to do what you want. A single Datastore entity can have a repeated property. It can also have a structured property (a property made out of other properties).

So, a single entity could be "form" with a repeated Structured Property called "day". That structured property could then contain the values of columns 1 through 5, with a value for "day".

So your single "form 1" will have a property "Day", which will contain " 1, Value 1,Value 1,Value 1,Value 1,Value 1", then another "Day" in the same "form 1", containing "2, Value 2, Value 2, Value 2, Value 2, Value 2", etc.

In JDO specifically, repeated properties are "collections", and structured properties are "embedded". You can see more information here [1]

I would personally suggest using Objectify or JPA if you're not bound to JDO.

I hope these helps! 

Good luck with the internship :)

spmadhupriya

unread,
Nov 21, 2015, 2:15:22 AM11/21/15
to google-a...@googlegroups.com
Hi Patrice,

Thank you so much.

--
You received this message because you are subscribed to a topic in the Google Groups "Google App Engine" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-appengine/9LrE1BexjhM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/63a70a96-dff6-4b19-9310-719622acfc01%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages