API Overview API Index Package Overview Direct link to this page
JavaOnTracks 0.1.2
  net.jot.persistance.query. JOTQueryInterface View Javadoc
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

/*
------------------------------------
JavaOnTracks          Thibaut Colar
tcolar-jot AT colar DOT net
Artistic Licence 2.0
http://www.javaontracks.net
------------------------------------
 */
package net.jot.persistance.query;

import net.jot.persistance.JOTTransaction;

import net.jot.db.JOTDBField;
import net.jot.persistance.JOTModel;
import net.jot.persistance.JOTModelMapping;
import net.jot.persistance.JOTQueryResult;
import net.jot.persistance.JOTStatementFlags;

/**
 * Interface to query implementations<br>
 * The query Implementations provide backend specific support for executing search querries for Models.
 * @author thibautc
 *
 */
public interface JOTQueryInterface {

	/**
	 * This is here, if you want to make manual custom SQL calls not covered by the other methods<br>
	 * 
	 * NOTE: your request MUST return records matching your model.<br>
	 * <b>THIS IS ONLY SUPPORTED WITH THE SQL Model (JOTDBModel)<b>
	 * 
	 * @param sql   ie: "select * from 'users' where first=?, last=? order by name" ... etc ...
	 * @param params ie: ['John','Doe']
	 * @return
	 */
	public JOTQueryResult executeSQL(JOTTransaction transaction, JOTModelMapping mapping, Class objectClass, String sql, Object[] params, JOTStatementFlags flags) throws Exception;

        /**
         * An "Update" type queries returns no results:
         * IE: insert, delete etc...
         * @param transaction
         * @param mapping
         * @param objectClass
         * @param sql
         * @param params
         * @param flags
         * @return
         * @throws java.lang.Exception
         */
        public void updateSQL(JOTTransaction transaction, JOTModelMapping mapping, String sql, Object[] params, JOTStatementFlags flags) throws Exception;
	
        /**
         * Saves record in backend
         * @param model
         * @throws java.lang.Exception
         */
	public void save(JOTTransaction transaction, JOTModel model) throws Exception;

        /**
         * Delete the WHOLE TABLE in backend
         * @param mapping
         * @throws java.lang.Exception
         */
	public void deleteTable(JOTTransaction transaction, JOTModelMapping mapping) throws Exception;
        /**
         * Delete the WHOLE TABLE in backend
         * @param mapping
         * @throws java.lang.Exception
         */
	public void createTable(JOTTransaction transaction, JOTModelMapping mapping) throws Exception;

        /**
         * Delete record in backend
         * @param model
         * @throws java.lang.Exception
         */
	//public void delete(JOTTransaction transaction, JOTModel model) throws Exception;

        /**
         * Add a new Field to a table
         * The field must be defined in the DB Model.
         * @throws java.lang.Exception
         */
        public void alterAddField(JOTTransaction transaction, JOTModelMapping mapping, JOTDBField field, Object defaultValue) throws Exception;
        
  
}

Generated By: JavaOnTracks Doclet 0.1.5     ©Thibaut Colar