cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use Integer instead of 'uuid' ?

necipakca
Champ in-the-making
Champ in-the-making
Hi all,

I am newbie on activiti ,grails and hibernate, big challange heh Smiley Happy
i have start to develop a project which is built on grails 2.1.0 and activiti plugin on it.

Firstly ,
The user table using uuid for user id but, i dont want to use uuid because of perfomance issue , The user id will be foreign key most table and it will occupy more place than integer in database. it is possible to change it with integer.

Secondly,
I can not use association types in process.
I mean,
There is a process which has createdUser and approvedUser properties and, these properties are a type of User class. When i designed this type of structure , it try to keep as seriazible type in act_ru_variable table, this is also performance issue. Maybe my approach is wrong.! Also i know that i can use property as String like in VocationRequest example but,i want to use benefit of hibernate.

Could someone give advise to me about using association types in process ?

Best Regards
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
The user table using uuid for user id but, i dont want to use uuid because of perfomance issue , The user id will be foreign key most table and it will occupy more place than integer in database. it is possible to change it with integer.

Activiti has two db id generators built in. It seems like the Grails plugin is using the one with UUID. The other db generator uses strings, not integers. In my opinion, for modern database this doesn't make any real performance difference. You would need to tweak a lot of other stuff first before that ever might be a performance issue (if it ever will be).

So to answer your question: yes it can, check the DBIdGenerator classes. But I wouldn't recommend it.

I can not use association types in process.
I mean,
There is a process which has createdUser and approvedUser properties and, these properties are a type of User class. When i designed this type of structure , it try to keep as seriazible type in act_ru_variable table, this is also performance issue. Maybe my approach is wrong.! Also i know that i can use property as String like in VocationRequest example but,i want to use benefit of hibernate.

You can use JPA entities and only store a reference to them in the activiti tables. See http://activiti.org/userguide/index.html#N1200A
In this case you are right: this will have a performance impact. But more importantly, there will only be one version of the data, which doesn't happen if you serialize and copy the bean in your process.