Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Re: How to persist a property of type List<String>in JPA

Reply
Thread Tools

Re: How to persist a property of type List<String>in JPA

 
 
Lew
Guest
Posts: n/a
 
      11-13-2008
On Nov 13, 10:40*am, Andrea Francia
<andrea.fran...@gmx.REMOVE_FROM_HERE_ohohohioquest oèdatogliereohohoho_TO_HERE.it>
wrote:
> What is the smartest way to get an entity with a field of type
> List<String> get persisted?


@OneToMany

In a normalized database, the List will correspond to a set of rows
from a related table.

It's a little unusual to have a table with only a single String
column, though. Usually there's a somewhat more complex structure.
What is the corresponding table structure?

--
Lew
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      11-13-2008
Lew wrote:
>> It's a little unusual to have a table with only a single String
>> column, though. *Usually there's a somewhat more complex structure.
>> What is the corresponding table structure?


Andrea Francia wrote:
> I want represents command line arguments of a command.
> The complete data structure should be something like that:
>
> Class data structure:
> ---------------------
> public class Command {
> * *private String workindDir; // where start the command
> * *private List<String> commandLineArguments; // command line arguments
> * *...
> }
>
> Instance example:
> -----------------
> workingDir = "/var/log"
> commandLineArguments = list of {"/bin/ls", "-l", "--color=always"}


That's not a table structure.

What's the corresponding table structure?

JPA is all about object-to-relational mapping (ORM). You haven't told
us the relational structure.

--
Lew

 
Reply With Quote
 
 
 
 
Andrea Francia
Guest
Posts: n/a
 
      11-13-2008
Lew wrote:
> That's not a table structure.


Sorry, I realize that I did not understand your question.
There is no a pre-existing table structure.

My problem is not the mapping a new object model to an existing table
structure. I need only persist a given object model.

--
Andrea Francia
http://andreafrancia.blogspot.com/20...o-windows.html
 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      11-13-2008
On Nov 13, 3:02*pm, Andrea Francia <andrea.fran...@REMOVE-FROM-
HERE.ohoihihoihoih.TO-HERE.gmx.it> wrote:
> Lew wrote:
> > That's not a table structure.

>
> Sorry, I realize that I did not understand your question.
> There is no a pre-existing table structure.
>
> My problem is not the mapping a new object model to an existing table
> structure. I need only persist a given object model.


So design a table structure.

--
Lew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
jpa persist , merge ? john Java 0 12-24-2010 05:51 PM
Re: How to persist a property of type List<String>in JPA Lew Java 0 11-13-2008 10:03 PM
Persist JPA Entity to a file system redbull Java 2 10-31-2007 08:41 PM
Why the designer don't persist the property of my control? (Advanced) Umut Tezduyar ASP .Net 0 11-29-2005 01:04 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57