-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
194 lines (183 loc) · 9.58 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MongoLink, An Object Document Mapper (ODM) for Java and MongoDB</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="MongoLink - An Object Document Mapper (ODM) for Java and MongoDB ">
<meta name="author" content="MongoLink">
<!-- Le styles -->
<link href="bootstrap/css/bootstrap.min.css?v=3" rel="stylesheet">
<link href="bootstrap/css/bootstrap-responsive.css?v=3" rel="stylesheet">
<link href="css/style.css?v=3" rel="stylesheet">
<link rel="shortcut icon" type="image/png" href="/images/favicon.png" />
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">GitHub<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/MongoLink/mongolink">mongolink</a></li>
<li><a href="https://github.com/MongoLink/mongolink-integrationtests">mongolink-integrationtests</a></li>
<li><a href="https://github.com/MongoLink/mongolink-example">mongolink-example</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">C.I.<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://travis-ci.org/MongoLink/mongolink">Travis</a></li>
<li><a href="https://twitter.com/MongoLink_ci">C.I. Twitter</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Maven<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="https://oss.sonatype.org/content/repositories/releases/">Releases</a></li>
<li><a href="https://oss.sonatype.org/content/repositories/snapshots/">Snapshots</a></li>
</ul>
</li>
<li><a href="https://twitter.com/MongoLink">Twitter</a></li>
</ul>
<ul class="nav pull-right">
<li><a class="build-status" href='https://travis-ci.org/MongoLink/mongolink'><img src='https://travis-ci.org/MongoLink/mongolink.svg?branch=master'></a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<div class="fork-me">
<a href="https://github.com/MongoLink"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"></a>
</div>
<header>
<img src="images/mongolink-256.png" alt="mongolink">
<br />
<img src="images/mongolink-logo-512.png" alt="mongolink">
<p>An Object Document Mapper (ODM) for Java and MongoDB</p>
<p>
<a class="btn btn-primary btn-large" href="https://github.com/MongoLink/mongolink">GitHub »</a>
</p>
</header>
<hr>
<div class="hero-unit">
<p>MongoLink was conceived to leave no footprints at all (or almost) on your project : no annotations, no super class to inherit. Mapping is declared through a fluent api directly in Java, and the configuration to get started is just a few lines long.</p>
</div>
<div class="row">
<div class="span12">
<h2>Quick start</h2>
<p>Here is a <a href="https://github.com/MongoLink/mongolink-example">sample project</a>, that should get you up and runnning quickly</p>
</div>
<div class="span12">
<h2 id="install">Install</h2>
<p>
You must of course <a href="http://docs.mongodb.org/manual/installation/">install</a> MongoDB. Then the simplest way to go is to use Maven, Gradle, or wathever build tool you fancy. Here is a sample configuration for Maven :
<script src="https://gist.github.com/BodySplash/0600d4e3118febf34a2e.js"></script>
Keep in a mind we also provide a snapshot repository for the more bleeding edge versions of MongoLink
</p>
</div>
<div class="span12">
<h2 id="configuration">Configuration</h2>
<p>
To work with MongoLink, you must use MongoSessionManager and MongoSession. MongoSessionManager is more or less a factory for MongoSession, and you may have only one instance of MongoSessionManager for your application.
<script src="https://gist.github.com/BodySplash/5394136.js"></script>
<script src="https://gist.github.com/BodySplash/5393630.js"></script>
</p>
</div>
<div class="span12">
<h2 id="mapping">Mapping</h2>
<p>Mapping with MongoLink is only declared through code :
<script src="https://gist.github.com/BodySplash/5393634.js"></script>
The «magic» here occures with the element() function. It returns an entity interceptor that let MongoLink register your functions. MongoLink will deduce your field names from functions.</p>
<p>You can also declare Value objects that can be use as properties of other objects :
<script src="https://gist.github.com/BodySplash/5393651.js"></script>
</p>
</div>
<div class="span12">
<h2 id="saving">Saving</h2>
Once you have a MongoSession instance, saving an entity is quite easy :
<script src="https://gist.github.com/BodySplash/5393662.js"></script>
</div>
<div class="span12">
<h2 class="reading">Reading</h2>
Retrieving an entity with its Id is also fairly easy :
<script src="https://gist.github.com/BodySplash/5393667.js"></script>
For more complexe scenarios, we are working on a criteria api :
<script src="https://gist.github.com/BodySplash/5393683.js"></script>
</div>
<div class="span12">
<h2 id="updating">Updating</h2>
Updates are automatics with MongoLink. Since all your work is encapsulated in a MongoSession, it can generate the update query that matchs your modifications. A simple call to mongoSession.stop() will do the trick :
<script src="https://gist.github.com/BodySplash/5393690.js"></script>
MongoLink supports two update strategies :
<ul>
<li>DIFF : generates only the modifiers needed</li>
<li>OVERWRITE : writes the whole document each time</li>
</ul>
</div>
<div class="span12">
<h2 id="deleting">Deleting</h2>
Once again, when you have a MongoSession, deleting is fairly easy :
<script src="https://gist.github.com/BodySplash/5393709.js"></script>
</div>
<div class="span12">
<h2 id="unittesting">Unit Testing</h2>
MongoLink provides a simple junit rule te ease unit testing. It will :
<ul>
<li>Setup MongoLink with <a href="https://github.com/foursquare/fongo">Fongo</a></li>
<li>Provide utility methods, as cleaning session </li>
</ul>
<script src="https://gist.github.com/BodySplash/5393728.js"></script>
</div>
</div>
<div class="row">
<div class="span6">
<h2>License</h2>
<p>MongoLink is free software: you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. </p>
</div>
<div class="span6">
<h2>Credits</h2>
<p>MongoLink was created by <a href="https://github.com/BodySplash">Jean-Baptiste Dusseaut</a> for <a href="http://arpinum.fr">Arpinum</a></p>
<p><a href="https://github.com/daviddumon">David Dumon</a> and <a href="https://github.com/couillardcharles">Charles Couillard</a> contribute greetly. </p>
<p>For a complete contributors list, see <a href="https://github.com/MongoLink/mongolink/blob/master/contributors.txt">this file</a></p>
<p>Logos by <a href="https://twitter.com/cedricnehemie">Cédric Néhémie</a>.</p>
</div>
</div>
<hr>
<footer>
<p>
<a href="https://twitter.com/MongoLink" class="twitter-follow-button" data-show-count="false">Follow @MongoLink</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://mongolink.org">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</p>
<p>Website built with <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap</a></p>
<p><a href="mailto:[email protected]">Contact</a></p>
</p>
</footer>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="bootstrap/js/jquery.js?v=3"></script>
<script src="bootstrap/js/bootstrap.min.js?v=3"></script>
</body>
</html>