Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
От | Віталій Тимчишин |
---|---|
Тема | Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4 |
Дата | |
Msg-id | AANLkTinbK92ZRqUqgfnB41NCgzX59xUa+Byt5EkFTa9n@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4 (Dave Cramer <pg@fastcrypt.com>) |
Ответы |
Re: Problems with Hibernate Discriminators and 9.0-801.jdbc4
|
Список | pgsql-jdbc |
2011/3/28 Dave Cramer <pg@fastcrypt.com>
On Mon, Mar 28, 2011 at 9:27 AM, Lew <noone@lewscanon.com> wrote:Really ??? the last time I checked the above will generate approx 5
> Chris Wareham wrote:
>>
>> Dave Cramer wrote:
>>>
>>> Ok, looking at the hibernate source this is what is in the
>>> PostgreSQLDialect
>>>
>>> public String getIdentitySelectString(String table, String column, int
>>> type) {
>>> return new StringBuffer().append("select currval('")
>>> .append(table)
>>> .append('_')
>>> .append(column)
>>> .append("_seq')")
>>> .toString();
>>> }
>>> }
>
>> Just as an aside, should that not be using a StringBuilder rather than
>> a StringBuffer? Or does Hibernate still explicitly support Java 1.4?
>
> My Red-Flag-O-Meter triggered on that, too. What Hibernate ought to do is:
>
> return "select currval('" + table + '_' + column + "_seq')";
>
> for Pete's sake.
objects StringBuffer.append is the recommended use for java 1.4,
StringBuilder is only marginally faster as it not synchronized.
+ or concat is much slower as it creates a new object each time and
copies the old into the new.
--
Best regards,
Vitalii Tymchyshyn
В списке pgsql-jdbc по дате отправления: