-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: NEWBIE - How to map a array of string = string[] values
PostPosted: Fri Apr 28, 2006 11:14 am 
Newbie

Joined: Thu Apr 27, 2006 7:01 pm
Posts: 8
Hibernate version:
NHibernate 1.0.2 - .Net 2.0 / VS2005

Mapping documents:
Don't have it yet.

Name and version of the database you are using:
SQL Server 2000 SP4


Hi, I am brand new to Nhibernate, I am trying to map an array of sting: string[] values to a table like this:

CREATE TABLE EngineRecValue(
ID INT IDENTITY(1,1) NOT NULL,
VALUE VARCHAR(255) NOT NULL)


Can I do this directly or do I have to create an object with ID And String and do an array of these objects ?

Newbie thanks you.

Christian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 12:14 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Code:
<primitive-array>
    <key column="engine_id" />
    <index column="id" />
    <element column="value" type="String(255)" />
</primitive-array>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 28, 2006 12:20 pm 
Newbie

Joined: Thu Apr 27, 2006 7:01 pm
Posts: 8
sergey wrote:
Code:
<primitive-array>
    <key column="engine_id" />
    <index column="id" />
    <element column="value" type="String(255)" />
</primitive-array>


thanks, I'll try it, will it be part of the parent class ?
or a separate one ? And can I specify the table name ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 7:28 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Yes, part of the parent class. You specify the table name in <primitive-array>, its usage is similar to that of <map>, <set>, etc.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.