java


Convert a SQL type into something else in Speedment


When Speedment generates entities from a database schema, is there some way to change the default type being generated? For an example, if I have a table like this:
create table comment (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
author_name VARCHAR(40) NOT NULL,
posted_date TIMESTAMP NOT NULL
);
By default Speedment will generate the TIMESTAMP column as java.sql.Timestamp. Can I make it so that TIMESTAMP columns are converted into Java long values instead?
In the Tool, select the "posted_date"-column on the left side and change the "Type Mapper" property to "Timestamp to Long". When you regenerate the code, then that column will be represented as a long instead.
If you want to create a custom type mapper, there is a good tutorial for that on the Speedment GitHub page.

Related Links

Many events are registered on a single touch in libgdx?
Why can't we use this instance in the static method of extended class?
java Parameter index out of range (1 > number of parameters, which is 0 with mysql - simple login
Java, thread.sleep() blocks use of buttons (does not recognize button clicks)
Include WSDL in OSGi bundle
How to avoid reading of DTD when parsing XML file in Java?
Code below Throws java.lang.reflect.InvocationTargetException
What exception to throw when trying to remove an element from an empty LinkedList? [closed]
Using KeyListener with Java
Button not Clicking - Selenium Web Driver using java
Splitting a string and building another string in java
Showing latest item at the bottom of ListView android
Java sorting an array of strings by increasing length using a comparator [closed]
How import eclipse project to android studio 0.4.6 ?
Hot swap decoration?
Avoid getting same look and feel info from previous class to next class in java

Categories

HOME
gitlab
gerrit
minimum-spanning-tree
tinymce
mean-stack
xmpp
leon
fancybox
webrequest
facebook-php-sdk
volttron
floating-action-button
qt-creator
postgres-xl
n-gram
circuit
systemc
tostring
transformation
predix
kryo
arabic
tar
php-openssl
android-widget
one-to-many
underflow
django-storage
chromebook
uninstall
publish
librato
microsoft-chart-controls
fog
winrt-xaml-toolkit
overriding
file-format
main
gesture
serverside-rendering
sharefile
jna
document.write
avro4s
quadratic-programming
fakeiteasy
segment
btrace
python-c-api
sybase-asa
mako
orthogonal
jquery-filter
vmware-tools
log4c
phishing
goose
historian
unity-networking
spim
qdialog
ibaction
sankey-diagram
web-controls
graph-api-explorer
c++03
umbraco6
oxwall
tablelayout
issuu
internet-connection
sgen
mechanize-ruby
concurrent-collections
oracle-warehouse-builder
cloud-connect
access-rights
gridfs
wsdl-2.0
isnullorempty
first-responder
frameset
ticoredatasync
qtkit
adk
self-extracting
table-footer
propagation
google-friend-connect
zend-translate
gamequery
forums
asp.net-profiles
bespin
ctp4
mdac
paul-graham
3gp
ajax-forms

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App