-->
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.  [ 1 post ] 
Author Message
 Post subject: mapping native database arrays to hibernate...
PostPosted: Thu Oct 06, 2005 8:34 am 
Newbie

Joined: Wed Jun 22, 2005 5:25 am
Posts: 6
Hibernate version:
hibernate-3.01

Name and version of the database you are using:
PostgreSQL 8.0.3

how can i map a table column that contains an array of for example floats into a variable of the type float[] in a java class?

so for example i have this test table:

\d testlist
Table "public.testlist"
Column | Type | Modifiers
--------+---------+--------------------------------------------------------------
testje | integer | not null default nextval('public.testlist_testje_seq'::text)
test | real[] |
Indexes:
"testlist_pkey" PRIMARY KEY, btree (testje)

and now i want to map that to a class like this :

public class TestList
{
private int testId;
private float[] list;

public TestList()
{

}

public int getTestId()
{
return testId;
}

public void setTestId(int testId)
{
this.testId = testId;
}

public float[] getList()
{
return list;
}

public void setList(float[] list)
{
this.list = list;
}

public String toString()
{
return "testList: " + testId;
}

}

can i accomplish this with <primitive-array> or <array> elements?

thanks


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

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.