JPA: How to associate entities with relationship attributes?
We can always do :
EntityA @OneToOne EntityB
EntityC @OneToMany EntityD
But what if you have relationship properties associated ?
Like:
EntityC -- JoinTable -- EntityD
|
|
EntityType
Now in this case my join table has 3 ids ( EntityC_id, EntityType_id,
EntityD_id )
How can I create an association with EntityC and EntityD ( With EntityType
) ?
Wednesday, 11 September 2013
draw charts lightweight libraries
draw charts lightweight libraries
I need to draw 3 graph inside my android app. Each graph will be inside a
fragment inside a viewPager layout, and each fragment will be keep in
memory while app is on focus. Also, when user tap on a point of graph a
popup with information of that point should appear. I0ve found afreechart
and achartengine libraries, but wich one is better for my purpose? the
main thing it's the lightweight memory request
I need to draw 3 graph inside my android app. Each graph will be inside a
fragment inside a viewPager layout, and each fragment will be keep in
memory while app is on focus. Also, when user tap on a point of graph a
popup with information of that point should appear. I0ve found afreechart
and achartengine libraries, but wich one is better for my purpose? the
main thing it's the lightweight memory request
Tuesday, 10 September 2013
FluentValidation server side validation
FluentValidation server side validation
I am new to FluentValidation .I have a quick question. in FluentValidation
we know we have .Must function for post back validation.In there can I
apply somthing like.."some database record existing validations" ?
rather than having basic validations do some server side validation done
with rule's Must function in FluentValidation is it good idea ?
I am new to FluentValidation .I have a quick question. in FluentValidation
we know we have .Must function for post back validation.In there can I
apply somthing like.."some database record existing validations" ?
rather than having basic validations do some server side validation done
with rule's Must function in FluentValidation is it good idea ?
Ajax - Json vs Text Performance
Ajax - Json vs Text Performance
I'm kind of confused and was hoping one of you could give me some clarity.
I am trying to get the best performance out of my Ajax request. The data
coming across the wire is a 1,000 row 10 column table. The debate is:
should I send Json or should I send Text? If I send Json, then doesn't
that mean I have to include the column name for each item? Basically, the
total size of the request will be increased by 10 x 1,000 in text inside
the Json. Or, I can send a CSV across the wire and exclude the column
names, thereby significantly reducing the size of the transfer. This has
its own performance implications though, because then I have to parse the
CSV on the client, rather than having it ready to go in Json. Thoughts
anyone? Thanks
I'm kind of confused and was hoping one of you could give me some clarity.
I am trying to get the best performance out of my Ajax request. The data
coming across the wire is a 1,000 row 10 column table. The debate is:
should I send Json or should I send Text? If I send Json, then doesn't
that mean I have to include the column name for each item? Basically, the
total size of the request will be increased by 10 x 1,000 in text inside
the Json. Or, I can send a CSV across the wire and exclude the column
names, thereby significantly reducing the size of the transfer. This has
its own performance implications though, because then I have to parse the
CSV on the client, rather than having it ready to go in Json. Thoughts
anyone? Thanks
Launch Wordpress Site from index
Launch Wordpress Site from index
I'm trying to launch a wordpress website from a non wordpress static home
page (index.html) using a button.
The index.html will provide users an option to leave me their email
contact info or redirect them to the wordpress site I have created when
they click the "Enter" button.
The wordpress site works fine when the standard wordpress index.php file
is located in the site root. When I replace this file with my own
index.html file (with the button and contact code), I can't get the
wordpress index.php file to launch. I renamed the original wordpress
index.php to indexWP.php and I call that file from my new index.html file
using the code suggestion here: A button to start php script, how?
<form action="indexwp.php" method="get">
<input type="submit" value="Enter">
</form>
When I use the above, it gives me a 404 Page Not Found error when I click
Enter.
The original Wordpress index.php looks like this (renamed to indexwp.php):
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but
loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
I'm a noob so I suspect it's something I'm misinterpreting with the above
sample code.
I'm trying to launch a wordpress website from a non wordpress static home
page (index.html) using a button.
The index.html will provide users an option to leave me their email
contact info or redirect them to the wordpress site I have created when
they click the "Enter" button.
The wordpress site works fine when the standard wordpress index.php file
is located in the site root. When I replace this file with my own
index.html file (with the button and contact code), I can't get the
wordpress index.php file to launch. I renamed the original wordpress
index.php to indexWP.php and I call that file from my new index.html file
using the code suggestion here: A button to start php script, how?
<form action="indexwp.php" method="get">
<input type="submit" value="Enter">
</form>
When I use the above, it gives me a 404 Page Not Found error when I click
Enter.
The original Wordpress index.php looks like this (renamed to indexwp.php):
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but
loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
require('./wp-blog-header.php');
I'm a noob so I suspect it's something I'm misinterpreting with the above
sample code.
Force nil elements in marshalled XML
Force nil elements in marshalled XML
I have a system which calls a web service, and passes the response back to
its own caller (mostly untouched). The problem is that in the response
which my system receives, several elements are marked as xsi:nil="true",
but in the response my system sends to its caller, those elements are
absent!
In my system, the schema which defines these elements defines them like this:
<xsd:element name="trmCode" type="xsd:string" nillable="true" minOccurs="1"/>
The Java code that is generated from the schema defines a class member
like this:
@XmlElement(required = true, nillable = true)
protected String trmCode;
The data I receive from the web service contains the element like this:
<trmCode xsi:nil="true" />
The first time I call my system's service, the element is returned like this:
<trmCode />
All subsequent calls don't include trmCode in the response at all. The
code that transfers data from the called web service's response to my
system's response is very simple:
outboundResponse.setListOfThings(inboundResponse.getListOfThings());
Where each "thing" in ListOfThings is an object with a trmCode member
(among others, all of which exhibit the same problem if they are null on
the inbound response).
Has anyone ever seen anything like this before? Does anyone have any ideas
how to ensure that my output will contain <trmCode xsi:nil="true"/>?
I have a system which calls a web service, and passes the response back to
its own caller (mostly untouched). The problem is that in the response
which my system receives, several elements are marked as xsi:nil="true",
but in the response my system sends to its caller, those elements are
absent!
In my system, the schema which defines these elements defines them like this:
<xsd:element name="trmCode" type="xsd:string" nillable="true" minOccurs="1"/>
The Java code that is generated from the schema defines a class member
like this:
@XmlElement(required = true, nillable = true)
protected String trmCode;
The data I receive from the web service contains the element like this:
<trmCode xsi:nil="true" />
The first time I call my system's service, the element is returned like this:
<trmCode />
All subsequent calls don't include trmCode in the response at all. The
code that transfers data from the called web service's response to my
system's response is very simple:
outboundResponse.setListOfThings(inboundResponse.getListOfThings());
Where each "thing" in ListOfThings is an object with a trmCode member
(among others, all of which exhibit the same problem if they are null on
the inbound response).
Has anyone ever seen anything like this before? Does anyone have any ideas
how to ensure that my output will contain <trmCode xsi:nil="true"/>?
Pulsing image-button in Java
Pulsing image-button in Java
I have created a simple musical metronome in Java. It starts and stops by
pressing a button that has the shape of a butterfly. I would love to add a
visual effect of the tempo by making the button/butterfly appear and
disappear together with the metronome beat.
Would java.util.Timer be the way to go? Would that work with an image that
is a button and that needs to keep its functions while pulsing?
Thank you so very much for suggestions and congratulations on the community.
I have created a simple musical metronome in Java. It starts and stops by
pressing a button that has the shape of a butterfly. I would love to add a
visual effect of the tempo by making the button/butterfly appear and
disappear together with the metronome beat.
Would java.util.Timer be the way to go? Would that work with an image that
is a button and that needs to keep its functions while pulsing?
Thank you so very much for suggestions and congratulations on the community.
Subscribe to:
Posts (Atom)