Questions tagged [datamapper]

Architectural pattern for separating application logic from storage.

Objects and relational databases have different mechanisms for structuring data.

The Data Mapper is a layer of software that separates the in-memory objects from the database. Its responsibility is to transfer data between the two and also to isolate them from each other. With Data Mapper the in-memory objects needn't know even that there's a database present; they need no SQL interface code, and certainly no knowledge of the database schema.

Pattern definition: http://martinfowler.com/eaaCatalog/dataMapper.html

1134 questions
0
votes
2 answers

Text Conversion to Database

Hello creative Developers and night rangers of StackOverflow, I have a customer who has around 20 thousand words for a dictionary in Microsoft Document files. He created it around 1 decade ago, now I have to load these *.doc files contents to a…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
0
votes
1 answer

Issue with Data Mapper And Sinatra in Ruby 1.9.3

I am sure this is a simple issue but since I have looked so long I cannot see it. So I am running ruby 1.9.3 with Sinatra, sqlite3, datamapper, dm-sqlite-adapter. When I try to run Sinatra, I get…
Red
  • 2,256
  • 5
  • 25
  • 38
0
votes
1 answer

datamapper orm advanced relationship

I use datamapper orm with codeigniter my table is: person id, name, related_person1_id, related_person2_id person can have 1 related_person1, 1 related_person2 how can i set the relationship in my model file ? it is described in the docu: class…
John Smith
  • 47
  • 8
0
votes
2 answers

Datamapper - next record in model

I have a Sinatra app using datamapper for its database handling. The app works by displaying a separate page for each ID in a table. The model has an id field, which is a serial value and it's set up as the key. Currently, I browse between records…
Nekkoru
  • 1,145
  • 2
  • 12
  • 18
0
votes
0 answers

Dynamically discovering underlying database in DataMapper

In Rails, I programmatically discover the underlying database via: ActiveRecord::Base.connection.adapter_name which returns "MySQL", "PostgreSQL", etc. What's the equivalent call for DataMapper? The best I've come up with…
fearless_fool
  • 33,645
  • 23
  • 135
  • 217
0
votes
0 answers

Datamapper breaks app when saving urls

I'm making a URL shortener application in Sinatra. It works as follows: The front page is a form with one field, to enter a long url into:
Amja
  • 1,315
  • 9
  • 25
0
votes
1 answer

PHP Datamapper And ORM

I am starting with PHP DATAMAPPER AND ORM.. I am completely new with it. Though I got knowledge about through google. It really found interesting. I have few doubts with it. Can I use Doctrine 2 library/ORM with my Core PHP Project. Or it is only…
Sankalp
  • 1,300
  • 5
  • 28
  • 52
0
votes
1 answer

Ruby DataMapper One-to-Many association won't save using :parent_key

I have setup the following model with specific parent and child keys: class Province include DataMapper::Resource property :name_short, String, key: true, length: 2, unique: true property :name_long, String, length: 1..50 has n,…
Gus Shortz
  • 1,711
  • 1
  • 15
  • 24
0
votes
0 answers

Ordering by a related model attribute in Ruby/Sinatra

I have simple Booking and Client models: class Client include DataMapper::Resource property :id, Serial property :name, String, required: true property :email, String, required: true #.... has n, :bookings, constraint:…
Adam
  • 475
  • 5
  • 18
0
votes
1 answer

How do configure the dao files to handle inserting a List in MyBatis

I have an object that has a variable that's a List like so: ExportQueue.java public class ExportQueue implements Serializable { private List errors; public List getErrors() { return errors; } public void…
kasdega
  • 18,396
  • 12
  • 45
  • 89
0
votes
1 answer

DataMapper Associations 'NoMethodError'

I am stuck with a problem and can't figure out where the problem is. Because I am relatively new you can hopefully help me :). First of all I am using padrino with the datamapper gem. I have a Trip and Accommodation model with a one_to_many…
schnika
  • 79
  • 8
0
votes
2 answers

DataMapper ORM relationships

table1(users) |ID|name |type | |1 |demo |admin | |2 |demoX |client| table2(visits) |ID|admin_id|visitor_id|visit_date|... |1 |1 |2 |2013-01-01|... admin(fk)->users(id) user(fk)->users(id) simple scheduler project, it contain 2…
Zalaboza
  • 8,899
  • 16
  • 77
  • 142
0
votes
1 answer

How can I check if DataMapper is connected?

Active Record has a method called connected? that returns true if Active Record is connected. Is there an equivalent for DataMapper? I can't find anything in the API docs. And if not, what is the most proper solution to check this?
vermin
  • 1,099
  • 2
  • 11
  • 17
0
votes
1 answer

Datamapper: How to count total score from has_many objects

I just started learning some database basics. I am using Ruby and the datamapper gem I have two simple objects: class Quote include DataMapper::Resource property :id, Serial property :saying, String, :required => true property :score,…
tobias.henn
  • 225
  • 2
  • 13
0
votes
1 answer

Datamapper IS NOT NULL query

How can I write the activerecord statement, Comments.where("attachment IS NOT NULL") in DataMapper ie., I want to execute "SELECT * FROM comments WHERE attachment IS NOT NULL; with DataMapper in rails. Please help; I am not much familiar with DM!
Sayuj
  • 7,464
  • 13
  • 59
  • 76