FAQ
Hello,
how can I create a custom Mysql adapter? I use cayenne 3.1M3.

I've tried:

1)
DataNode node = new DataNode(...);
dataNode.setAdapter(new MySQLAdapter());

2)
Provider<DbAdapter> adapterProvider = new Provider<DbAdapter>() {

public DbAdapter get() throws ConfigurationException {
MySQLAdapter adapter = new MySQLAdapter();
return adapter;
}
};
AutoAdapter autoAdapter = new AutoAdapter(adapterProvider, logger);

--------------------------------

everytime I get following Exception:
Exception in thread "main" org.apache.cayenne.CayenneRuntimeException:
[v.3.1M3 Sep 12 2011 19:59:45] java.lang.NullPointerException
at
org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:840)
at
org.apache.cayenne.access.DataDomainQueryAction.runQueryInTransaction(DataDomainQueryAction.java:392)
at
org.apache.cayenne.access.DataDomainQueryAction.execute(DataDomainQueryAction.java:121)
at
org.apache.cayenne.access.DataDomain.onQueryNoFilters(DataDomain.java:708)
at
org.apache.cayenne.access.DataDomain$DataDomainQueryFilterChain.onQuery(DataDomain.java:958)
at org.apache.cayenne.access.DataDomain.onQuery(DataDomain.java:698)
at
org.apache.cayenne.util.ObjectContextQueryAction.runQuery(ObjectContextQueryAction.java:336)
at
org.apache.cayenne.util.ObjectContextQueryAction.executePostCache(ObjectContextQueryAction.java:104)
at
org.apache.cayenne.util.ObjectContextQueryAction.execute(ObjectContextQueryAction.java:91)
at org.apache.cayenne.access.DataContext.onQuery(DataContext.java:990)
at org.apache.cayenne.access.DataContext.performQuery(DataContext.java:979)
at
org.example.cayenne.persistent.DynamicMain.selectTutorial(DynamicMain.java:271)
at org.example.cayenne.persistent.DynamicMain.main(DynamicMain.java:252)
Caused by: java.lang.NullPointerException
at org.apache.cayenne.access.DataNode.performQueries(DataNode.java:281)
at
org.apache.cayenne.access.DataDomainQueryAction.runQuery(DataDomainQueryAction.java:422)
at
org.apache.cayenne.access.DataDomainQueryAction.access$000(DataDomainQueryAction.java:69)
at
org.apache.cayenne.access.DataDomainQueryAction$2.transform(DataDomainQueryAction.java:395)
at
org.apache.cayenne.access.DataDomain.runInTransaction(DataDomain.java:828)
... 12 more

best regards

--
View this message in context: http://cayenne.195.n3.nabble.com/Myslq-Adapter-tp3828735p3828735.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 9 | next ›
Discussion Overview
groupuser @
categoriescayenne
postedMar 15, '12 at 1:20p
activeMar 15, '12 at 4:17p
posts9
users3
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase