- This topic has 4 replies, 2 voices, and was last updated 18 years, 1 month ago by
Muhammad FAisal.
-
AuthorPosts
-
Muhammad FAisalMemberHello,
I am having one table having one primary key and for that i use oracle sequence to generate its value, i want to use it from spring-config.xml file?while reverse engineering of tables ? can any one tell me how to do it ?
Thanks
Faisal khanMay 29, 2007 at 10:15 am #270791
Riyad KallaMemberFaisal,
I don’t understand the request. When you reverse engineer the table you will get a POJO who’s key has a generator value of native to let the table assign it’s value. That’s fine.I don’t understand your spring question though… how does this relate to Spring?
May 29, 2007 at 11:35 pm #270843
Muhammad FAisalMemberok i try to repat the question,
I have one column hold primary key, we need to put every time uniqe value for it, i have one oracle sequence when we execute that sequence it generate different value from previously generated then we insert that value into that table.
I saw one example some thing like this
<id name=”userId” type=”integer” column=”USER_ID” >
<generator class=”sequence”>
<param name=”sequence”>MD_USER_SEQ</param>
</generator>
</id>which i guess automaticaly call sequence inside oracle and assign value to the userid.
but we have t do it manualy if i m not wrong,
while reverse enginering i saw option to configure for column but do not know how to use.hope nnow you understand the question clearly.
Thanks
Faisal khanMay 29, 2007 at 11:55 pm #270846
Riyad KallaMemberFaisal,
I believe what you want is to set the value to “native” which means the database takes care of the value, otherwise “Sequence” tells Hibernate to generate a sequential value for the field.May 30, 2007 at 11:56 pm #270905
Muhammad FAisalMemberI understand that.
but do you think if we assign sequence from reverse engineering dialog to any specifc col, does it ask for sequence name which i want to bound for specific column ?
<id name=”userId” type=”integer” column=”USER_ID” >
<generator class=”sequence”>
<param name=”sequence”>MD_USER_SEQ</param>
</generator>
</id>Faisal khan
-
AuthorPosts