question one :
why display ??? in my application ?
i have a big text column, i use mapping:
Code:
<property
name="content"
type="text"
update="true"
insert="true"
column="content"
not-null="true"
/>
when i use mysql , everything is ok
but when i use oracle , varchar2 column can display chinese well ,but clob can't , just display byte code
why?
another question:
i found that hibernate can auto export sql to create tables and build indexes , i wanna konw , if i wanna build extra index , can i do it in hibernate ? or what only i can do is use native db configuration?
and last one:
yestoday , i use hibernate to insert my oracle db , tables like this :
Code:
alter table ForumUser drop constraint FKF1AE946CB393BC38
alter table ForumUser drop constraint FKF1AE946CCA528358
alter table ForumUser drop constraint FKF1AE946CCE2B2E26
alter table Post drop constraint FK260CC0B8D40B54
alter table Post drop constraint FK260CC02D26E728
alter table Post drop constraint FK260CC057D5BCA5
alter table Forum drop constraint FK40E9D014D477E99
alter table announce drop constraint FKD9479469D7A2D1FC
alter table Thread drop constraint FK9545FA2AB8D40B54
alter table Thread drop constraint FK9545FA2AD7A2D1FC
drop table ForumUser cascade constraints
drop table UserInfo cascade constraints
drop table Category cascade constraints
drop table Post cascade constraints
drop table Forum cascade constraints
drop table Skin cascade constraints
drop table Pic cascade constraints
drop table announce cascade constraints
drop table Thread cascade constraints
drop sequence hibernate_sequence
create table ForumUser (
forumUserID NUMBER(10,0) not null,
userID NUMBER(10,0) not null,
signature VARCHAR2(500),
postCount NUMBER(10,0),
title VARCHAR2(100),
faceID NUMBER(10,0) not null,
lastVisit DATE not null,
active NUMBER(1,0) not null,
invisible NUMBER(1,0) not null,
acceptPriMsg NUMBER(1,0) not null,
autoLogin NUMBER(1,0) not null,
emailNotice NUMBER(1,0) not null,
showSign NUMBER(1,0) not null,
skinID NUMBER(10,0) not null,
primary key (forumUserID)
)
create table UserInfo (
userID NUMBER(10,0) not null,
userName VARCHAR2(16) not null,
registerDate DATE,
location VARCHAR2(20),
passWord VARCHAR2(32) not null,
email VARCHAR2(50) not null,
QQ VARCHAR2(15),
MSN VARCHAR2(50),
sex NUMBER(1,0) not null,
passWordQuestion VARCHAR2(100),
passWordQuestionAnswer VARCHAR2(100),
primary key (userID)
)
create table Category (
categoryID NUMBER(10,0) not null,
categoryName VARCHAR2(50) not null,
active NUMBER(1,0) not null,
expand NUMBER(1,0) not null,
displayOrder NUMBER(10,0) not null,
description VARCHAR2(200),
createDate DATE not null,
primary key (categoryID)
)
create table Post (
postID NUMBER(10,0) not null,
subject VARCHAR2(100) not null,
postTime DATE not null,
ip VARCHAR2(15) not null,
notes VARCHAR2(250),
enableFNCode NUMBER(1,0) not null,
enableHtml NUMBER(1,0) not null,
enableSignature NUMBER(1,0) not null,
enableSmile NUMBER(1,0) not null,
content CLOB not null,
visuable NUMBER(1,0) not null,
iconID NUMBER(10,0) not null,
threadID NUMBER(10,0) not null,
posterID NUMBER(10,0) not null,
attachFile VARCHAR2(255),
emailNotice NUMBER(1,0) not null,
enableImg NUMBER(1,0) not null,
primary key (postID)
)
create table Forum (
forumID NUMBER(10,0) not null,
forumName VARCHAR2(50) not null,
allowRate NUMBER(1,0) not null,
needConfirm NUMBER(1,0) not null,
createDate DATE not null,
countPost NUMBER(1,0) not null,
description VARCHAR2(200),
postCount NUMBER(10,0) not null,
threadCount NUMBER(10,0),
runTimeThreadCount NUMBER(10,0) not null,
lastPostTime DATE,
lastPoster VARCHAR2(16),
adminList VARCHAR2(150),
active NUMBER(1,0) not null,
displayOrder NUMBER(10,0) not null,
categoryID NUMBER(10,0) not null,
primary key (forumID)
)
create table Skin (
skinID NUMBER(10,0) not null,
skinName VARCHAR2(50) not null,
skinDesc VARCHAR2(250),
skinUrl VARCHAR2(100) not null,
isDefault NUMBER(1,0) not null,
primary key (skinID)
)
create table Pic (
picID NUMBER(10,0) not null,
picName VARCHAR2(10) not null,
picUrl VARCHAR2(100) not null,
typeID NUMBER(5,0) not null,
primary key (picID)
)
create table announce (
announceID NUMBER(10,0) not null,
subject VARCHAR2(100) not null,
content CLOB,
startDate DATE not null,
endDate DATE not null,
forumID NUMBER(10,0) not null,
poster VARCHAR2(16) not null,
postTime DATE not null,
primary key (announceID)
)
create table Thread (
threadID NUMBER(10,0) not null,
visualable NUMBER(1,0) not null,
closed NUMBER(1,0) not null,
lastPostTime DATE,
sticked NUMBER(1,0) not null,
replyCount NUMBER(10,0),
hitCount NUMBER(10,0),
notes VARCHAR2(250),
iconID NUMBER(10,0) not null,
poster VARCHAR2(16) not null,
lastPoster VARCHAR2(16),
subject VARCHAR2(100) not null,
forumID NUMBER(10,0) not null,
primary key (threadID)
)
alter table ForumUser add constraint FKF1AE946CB393BC38 foreign key (faceID) references Pic
alter table ForumUser add constraint FKF1AE946CCA528358 foreign key (skinID) references Skin
alter table ForumUser add constraint FKF1AE946CCE2B2E26 foreign key (userID) references UserInfo
alter table Post add constraint FK260CC0B8D40B54 foreign key (iconID) references Pic
alter table Post add constraint FK260CC02D26E728 foreign key (posterID) references ForumUser
alter table Post add constraint FK260CC057D5BCA5 foreign key (threadID) references Thread
create index IX260CC057D5BCA5 on Post (threadID)
alter table Forum add constraint FK40E9D014D477E99 foreign key (categoryID) references Category
create index IX40E9D014D477E99 on Forum (categoryID)
alter table announce add constraint FKD9479469D7A2D1FC foreign key (forumID) references Forum
create index IXD9479469D7A2D1FC on announce (forumID)
alter table Thread add constraint FK9545FA2AB8D40B54 foreign key (iconID) references Pic
alter table Thread add constraint FK9545FA2AD7A2D1FC foreign key (forumID) references Forum
create index IX9545FA2AD7A2D1FC on Thread (forumID)
create sequence hibernate_sequence
this file export by hibernate , i don't do anything more on my db
and then , i begin to inerst about 5 millions posts , but when i get up this moring , it only do 10% , took 12 hour
why? is it becouseof so many foreign key and indexes? how can i optimize it in hibernate?
thanks for your attention!