Java LocalDate implements Comparable<ChronoLocalDate>, but it should have implemented Comparable<LocalDate> to allow for creating a Range<LocalDate>. This is so because the declaration is Range<T extends Comparable<T>>:
spring-data-commons/src/main/java/org/springframework/data/domain/Range.java
The question is could the spring-data-commons Range have the following class declaration:
public class Range<T extends Comparable<? super T>> {
This could maybe help with being able to create Range<LocalDate>.
Related
THIS IS Current code
public class Ticket_Tabs extends TabActivity {
// TabActivity is the inbuilt class of androoid
public class navigation_drawer_class extends Activity
//This is my another class
public interface navigation_drawer_interface extends Serializable
{
navigation_drawer_class obj=new navigation_drawer_class();
}//THIS is interface
I expect,
public class Ticket_Tabs extends TabActivity,navigation_drawer_class {
How can achive this Iam new to android. I am just trying to show the navigation drawer to the TabActivity .
I already tried diffrent ways but i an failed to implement. Please suggest me solution if any.I also read may tpoics related to this on stack overflow but I cant understand. So please help me.
Thanks in advance
public class Ticket_Tabs extends TabActivity impplements Serializable {
//I tried this but not working ##Taslim
I'm using a global custom repository in my project which extends QueryDslJpaRepository:
public class CustomPagingAndSortingRepositoryImpl<T, ID extends Serializable> extends QueryDslJpaRepository<T, ID>
implements CustomPagingAndSortingRepository<T, ID> {
And the interface:
public interface CustomPagingAndSortingRepository<T, ID extends Serializable>
extends JpaRepository<T, ID>, QueryDslPredicateExecutor<T> {
And then on my configuration I annotate it with:
#EnableJpaRepositories(repositoryBaseClass = CustomPagingAndSortingRepositoryImpl.class)
All is working fine, but now I was trying to add auditing support to my entities by using spring-data-envers and according to the docs I should use a specific repository factory bean class :
#EnableJpaRepositories(repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class, repositoryBaseClass = CustomPagingAndSortingRepositoryImpl.class)
Now obviously if I do this things won't work because my repositories will now be created through the EnversRevisionRepositoryFactoryBean class and will no longer be of CustomPagingAndSortingRepositoryImpl type.
How can I support something like this? I'm not seeing how since my custom repository need to extend from QueryDslJpaRepository already.
I think the relevant part for you is this method of EnversRevisionRepositoryFactoryBean:
#Override
protected Class<?> getRepositoryBaseClass(RepositoryMetadata metadata) {
return EnversRevisionRepositoryImpl.class;
}
Here you really want your CustomPagingAndSortingRepositoryImpl returned. So I would try the following:
extend EnversRevisionRepositoryFactoryBean and overwrite getRepositoryBaseClass to return your CustomPagingAndSortingRepositoryImpl.
Make CustomPagingAndSortingRepositoryImpl extend EnversRevisionRepositoryImpl.
i am in this situation:
#RemoteServiceRelativePath("create_event")
public interface CreateEventService extends RemoteService {
String[] createeventServer(LinkedList<LinkedList<String>> input) throws IllegalArgumentException;
}
public interface CreateEventServiceAsync {
void createeventServer(LinkedList<LinkedList<String>> input, AsyncCallback<String[]> callback)
throws IllegalArgumentException;
}
public class CreateEventServiceImpl extends RemoteServiceServlet implements CreateEventService {
public String[] createeventServer(LinkedList<LinkedList<String>> input) throws IllegalArgumentException {
String[] arr = new String[2];
...
return arr;
}
Why does this cause error "The response could not be deserialized"?
p.s. I have tried to execute the project with app engine and without it, but the problem is the same.
To problems with serializable objects, you can try this check list:
Verify that the class has a default constructor (without arguments)
Verify that the class implements Serializable or IsSerializable or
implements an Interface that extends Serializable or extends a class
that implement Serializable
Verify that the class is in a client.* package or …
Verify, if the class is not in client.* package, that is compiled in
your GWT xml module definition. By default is present. If your class
is in another package you have to add it to source. For example if
your class is under domain.* you should add it to xml as . Be aware
that the class cannot belong to server package! More details on GWT
page:
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
If you are including the class from another GWT project you have to
add the inherits to your xml module definition. For example if your
class Foo is in the package com.dummy.domain you have to add to the
module definition. More details here:
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideInheritingModules
If you are including the class from another GWT project released as
a jar verify that the jar contains also the source code because GWT
recompile also the Java source for the classes passed to the Client.
Font: http://isolasoftware.it/2011/03/22/gwt-serialization-policy-error/
what can I do to make the abstract function work in the emaillogger class?
class EmailLogger extends Zend_Log_Writer_Abstract
and I want to use the function _write
protected function _write($event)
{
$this->_events[] = $this->_formatter->format($event);
}
then I got this error
Class EmailLogger contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Zend_Log_FactoryInterface::factory)
I am not really sure what to do here
I try'd to use implements Zend_Log_FactoryInterface, but it diddn't work
thanks, Richard
Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface which has the following code:
static public function factory($config);
This forces the Zend_Log_Writer_Abstract and any child classes to also have a factory method. To satisfy this requirement, you could put in a wrapper method which calls the parent method:
class EmailLogger extends Zend_Log_Writer_Abstract
{
// Add this method in conjunction to what you already have in your class
public static function factory($config)
{
parent::factory($config);
}
}
I am having trouble serializing an object over GWT that contains a sub class that is cast to its base class. My class hierarchy is as follows:
public class BaseManagedObject implements IsSerializable
{
public Shortcut getShortcut()
{
return new Shortcut();
}
}
public class User extends BaseManagedObject implements IsSerializable
{
public Shortcut getShortcut()
{
return new DomainMemberShortcut();
}
}
public class Shortcut implements IsSerializeable {}
public class DomainMemberShortcut extends Shortcut implements IsSerializable {}
When I serialize a User object, I get "The response could not be deserialized". If I change User to return a Shortcut in getShortcut(), there is no problem. I added code that references the DomainMemberShortcut, just to verify that I can build with it, and that works fine.
Any suggestions?
Thanks,
Found the solution - I was missing the default no-arg constructor in the DomainMember subclass.