datamapper / dm-types

DataMapper plugin providing extra data types
http://datamapper.org/
MIT License
55 stars 80 forks source link

UUID: got error on jruby #55

Open walla opened 12 years ago

walla commented 12 years ago

Hi! Got this error when using dm on jruby with UUID field type: ERROR: column "c$uuid" is of type uuid but expression is of type character varying Hint: You will need to rewrite or cast the expression. Position: 88 (code: 0, sql state: 42804, query: INSERT INTO "t$gp_events" ("c$uuid", "c$number", "c$s", "c$tx", "c$ac", "c$d") VALUES ('48cfcb78-5883-4d58-b81c-b4d2e6dd304b', '100487', '1.0', '1000000041342594267', '68473', '2012-04-23 16:03:14.000000 +04:00:00'), uri: )

my model:

class Events
  include DataMapper::Resource
  storage_names[:default] = 't$gp_events'
  property :uuid, UUID, :field => 'c$uuid', :key => true
  property :number, Integer, :field => 'c$number'
  property :s, Float, :field => 'c$s'
  property :tx, Integer, :field => 'c$tx'
  property :ac, Integer, :field => 'c$ac'
  property :d, DateTime, :field => 'c$d'
end

everything fine on MRI

ghost commented 12 years ago

The UUID property will end up in the database as a simple string, dm-types doesn't know about the uuid column type.

walla commented 12 years ago

sure. but just the same code works fine with MRI(1.9.2) and give such error on JRuby(1.6.7) datamapper 1.20