extends the tabactivity class through the custom class inthe android - interface

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

Related

Mixing Spring Data Envers and QueryDSL

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.

Java, spring-data-commons, cannot create Range<LocalDate>, why?

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>.

Wrapping Spring Data JPA with ApsectJ

Is it possible?
Currently I am using some aspects for my MVC controllers, what works really fine. I'm wrapping their responses and I have desired effect.
I also want to do this with Spring Data JPA repositories. But since they're generated based on the interface e.g:
public interface SomeRepository<T extends Some, ID extends Serializable> extends
BaseRepository<T, ID>, JpaSpecificationExecutor<T> {
public List<T> findById(Long id)
}
It generates me controller which is ready to use:
http://localhost:8080/findById?id=1234
I also want to wrap this controller. Is it possible?
This should work:
#Component
#Aspect
public class MyAdvice {
#Before("execution(* com.company.jpa.SomeRepository+.findById(..))")
public void intercept() { ... }
}
Basically, we are telling the framework to intercept the call to the findById method on any sub-class of SomeRepository.
Here is a sample application demonstrating this in action.

I cannot serialize a sub class that is cast to its base class over GWT

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.

GWT: transmit an interface with an IsSerializable Object

Good morning everybody,
I'm trying to transmit the following calls with an GWT RPC call:
public class MVCController extends Composite implements IsSerializable {
//..
private MVCClass listeners;
public void addListener(MVCClass _listener){
listeners = _listener;
}
//....
}
The MVCClass is the following interface:
import com.google.gwt.user.client.rpc.IsSerializable;
public interface MVCInterface extends IsSerializable{
public abstract void labelTextChange(String _text);
}
Whenever I make the RPC call, the application crashes, saying something about
Failed to create an instance of ... via deferred binding
Can I send an Interface with an RFC call?
Regards Stefan
You can not serialize a gwt widget that is why you get that exception. Your class MVCController extends from Composite whose base class is Widget..