Ruby DataMapper: is there an equivalent to Java Hibernate' component mapping?

961 views Asked by At

Coming from a Java/Hibernate environment, I can map some columns within a table to be a "component" that is belongs to a parent class. For example an User object contains a Preference object, which actually mapped all the attributes into one table in the database.

Is there anything similar in DataMapper? or other database interfacing library?

1

There are 1 answers

0
snusnu On BEST ANSWER

DataMapper currently doesn't support this feature, but it's on the roadmap and is referred to as "embedded value". ActiveRecord supports defining embedded values already.

As long as DataMapper has no builtin support for embedded values, they can be "faked" by following the pattern outlined in https://gist.github.com/873428