Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Custom Partitioning Policy

Hello,
i have trouble implementing a custom partitioning policy.

For testing purposes I'm trying to use a hashpartitioning but "attaching" it to the model class via @Partitioning. I created MyHashPartitioning which inherits from HashPartitioning and just sets its partitionField and unionUnpartitionableQueries fields with a default constructor like this:

public class MyHashPartitioningPolicy extends HashPartitioningPolicy {
	public MyHashPartitioningPolicy() {
		super("id", true);
	}
}

When I now attach it to the model via
@Partitioning(name = "part", partitioningClass = MyHashPartitioningPolicy.class)
@Partitioned("part")

It does not work and I get NPE warnings plus it doesn't find any data of the partitioned class.
Warnings:
[EL Warning]: 2011-11-08 17:16:05.921--ClientSession(18012736)--java.lang.NullPointerException
[EL Warning]: 2011-11-08 17:16:05.921--UnitOfWork(11982507)--java.lang.NullPointerException
[EL Warning]: 2011-11-08 17:16:05.921--ClientSession(21048949)--java.lang.NullPointerException
[EL Warning]: 2011-11-08 17:16:05.921--ClientSession(5312057)--java.lang.NullPointerException
[EL Warning]: 2011-11-08 17:16:05.921--UnitOfWork(24966838)--java.lang.NullPointerException
[EL Warning]: 2011-11-08 17:16:05.921--UnitOfWork(19488744)--java.lang.NullPointerException

When I use the normal way with

@HashPartitioning(name = "plantPart", unionUnpartitionableQueries=true, partitionColumn = @Column(name="id"))

It does work, however, and it finds the elements and I don't get any warnings.

Regards,
Michael
___________________________________________________

SMA Solar Technology AG
Aufsichtsrat: Guenther Cramer (Vorsitzender)
Vorstand: Juergen Dolle, Roland Grebe, Uwe Hertel, Pierre-Pascal Urbon, Marko Werner
Handelsregister: Amtsgericht Kassel HRB 3972
Sitz der Gesellschaft: 34266 Niestetal
USt-ID-Nr. DE 113 08 59 54
WEEE-Reg.-Nr. DE 95881150
___________________________________________________



Back to the top